From 04ee84fc20760dd2189dfa45fc1f01e4b21ea8a9 Mon Sep 17 00:00:00 2001
From: Jonas Nyrup
Date: Sat, 11 Feb 2023 17:18:45 +0100
Subject: [PATCH 01/98] update version
---
docs/_pages/releases.md | 6 ++++--
docs/index.html | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/docs/_pages/releases.md b/docs/_pages/releases.md
index faca38477d..3228d54f07 100644
--- a/docs/_pages/releases.md
+++ b/docs/_pages/releases.md
@@ -12,10 +12,12 @@ sidebar:
### What's new
### Fixes
-* Fixed hanging of `CompleteWithinAsync` when used with `WithResult` and `AssertionScope` - [#2101](https://github.com/fluentassertions/fluentassertions/pull/2101)
-* `BeEquivalentTo` no longer crashes on fields hiding base-class fields - [#1990](https://github.com/fluentassertions/fluentassertions/pull/1990)
+## 6.10.0
+### Fixes
+* Fixed hanging of `CompleteWithinAsync` when used with `WithResult` and `AssertionScope` - [#2101](https://github.com/fluentassertions/fluentassertions/pull/2101)
+* `BeEquivalentTo` no longer crashes on fields hiding base-class fields - [#1990](https://github.com/fluentassertions/fluentassertions/pull/1990)
* Fixed System.Net.Http dependency declaration for net47 target framework to be a framework dependency instead of a nuget dependency - [#2122](https://github.com/fluentassertions/fluentassertions/pull/2122)
## 6.9.0
diff --git a/docs/index.html b/docs/index.html
index 1c4e81bd6d..8c6b5121c7 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -6,8 +6,8 @@
overlay_color: "#373737"
overlay_filter: "0.7"
overlay_image: "/assets/images/fluent_assertions_large_horizontal.svg"
- cta_label: "Hello 2023! Here's Fluent Assertions 6.9!"
- cta_url: "https://fluentassertions.com/releases/#680"
+ cta_label: "Fluent Assertions 6.10 is out!"
+ cta_url: "https://fluentassertions.com/releases/#6100"
caption: "Logo by [**IUserName**](https://github.com/IUsername) and icons by [**Zlatko Najdenovski**](https://www.flaticon.com/authors/zlatko-najdenovski) from [Flaticon](https://www.flaticon.com/)
"
excerpt: '_"There''s a life before Fluent Assertions, and there''s a life after it"_ - [Meisam Alifallahi](https://www.linkedin.com/in/meisam-alifallahi/)
From 55023d5596805ba55565c01a43e82f1f008503ca Mon Sep 17 00:00:00 2001
From: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com>
Date: Tue, 14 Feb 2023 07:25:17 +0100
Subject: [PATCH 02/98] Add optional build parameter to generate a `binlog`
file (#2127)
---
.gitignore | 1 +
.nuke/build.schema.json | 4 ++++
Build/Build.cs | 7 +++++++
3 files changed, 12 insertions(+)
diff --git a/.gitignore b/.gitignore
index b75671262e..ee534ee6da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,6 +46,7 @@ packages/**
*.tmp
*.tmp_proj
*.log
+*.binlog
*.vspscc
*.vssscc
.builds
diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json
index 04602534eb..dc9c2e1388 100644
--- a/.nuke/build.schema.json
+++ b/.nuke/build.schema.json
@@ -10,6 +10,10 @@
"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"
diff --git a/Build/Build.cs b/Build/Build.cs
index 7d2b7631e5..809bde6c05 100644
--- a/Build/Build.cs
+++ b/Build/Build.cs
@@ -41,6 +41,10 @@ class Build : NukeBuild
string BuildNumber => GitHubActions?.RunNumber.ToString();
string PullRequestBase => GitHubActions?.BaseRef;
+ [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;
+
[Parameter("The key to push to Nuget")]
[Secret]
readonly string NuGetApiKey;
@@ -124,6 +128,9 @@ class Build : NukeBuild
DotNetBuild(s => s
.SetProjectFile(Solution)
.SetConfiguration(Configuration.CI)
+ .When(GenerateBinLog is true, _ => _
+ .SetBinaryLog(ArtifactsDirectory / $"{Solution.Core.FluentAssertions.Name}.binlog")
+ )
.EnableNoLogo()
.EnableNoRestore()
.SetAssemblyVersion(GitVersion.AssemblySemVer)
From 66c33216d25bf999b78d862281c88028a6318e9e Mon Sep 17 00:00:00 2001
From: Martin Costello
Date: Fri, 17 Feb 2023 18:46:09 +0000
Subject: [PATCH 03/98] Dynamic copyright year (#2128)
Remove the need to ever update the copyright year again by having MSBuild dynamically insert the current year.
---
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 ee4c7c1654..817254eadd 100644
--- a/Src/FluentAssertions/FluentAssertions.csproj
+++ b/Src/FluentAssertions/FluentAssertions.csproj
@@ -28,7 +28,7 @@
Apache-2.0
FluentAssertions.png
See https://fluentassertions.com/releases/
- Copyright Dennis Doomen 2010-2023
+ Copyright Dennis Doomen 2010-$([System.DateTime]::Now.ToString(yyyy))
false
From d2088e592beef7f27bde4004cd90d85dbc891eb4 Mon Sep 17 00:00:00 2001
From: Dennis Doomen
Date: Sat, 4 Feb 2023 14:06:32 +0100
Subject: [PATCH 04/98] Tweaked the editorconfig and Rider/R# auto-cleanup
profile
---
.editorconfig | 32 +++++++++++++--
FluentAssertions.sln.DotSettings | 69 +++++++++++++++++++++-----------
Tests/.editorconfig | 5 ++-
3 files changed, 78 insertions(+), 28 deletions(-)
diff --git a/.editorconfig b/.editorconfig
index 07ba3633da..1dfa065e14 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,7 +1,7 @@
+root = true
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
-root = true
# Global settings
[*]
@@ -266,12 +266,38 @@ dotnet_diagnostic.AV2305.severity = none
# AV2407: Region should be removed
dotnet_diagnostic.AV2407.severity = none
-# ReSharper/Rider
# Convert lambda expression to method group
resharper_convert_closure_to_method_group_highlighting = none
+# Start each element in a object or collection initializer on a new line
resharper_wrap_object_and_collection_initializer_style = chop_always
+# Force an empty line
resharper_blank_lines_after_multiline_statements = 1
-resharper_keep_existing_initializer_arrangement = false
\ No newline at end of file
+# Don't remove existing line breaks
+resharper_keep_existing_initializer_arrangement = true
+resharper_keep_existing_arrangement = true
+
+# We care about that extra else after an else-if
+resharper_redundant_if_else_block_highlighting = none
+
+# Don't remove explicit default cases in switch statements
+resharper_redundant_empty_switch_section_highlighting = none
+
+resharper_align_multiline_binary_expressions_chain = false
+
+# 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
+
+# Indent 4 spaces per necessary indention
+resharper_continuous_indent_multiplier = 1
+
+# Avoid breaking a generic definition
+resharper_wrap_before_extends_colon = true
+
+resharper_blank_lines_before_multiline_statements = 1
+
+resharper_parentheses_non_obvious_operations = arithmetic, multiplicative, equality, relational, additive
+resharper_parentheses_redundancy_style = remove_if_not_clarifies_precedence
diff --git a/FluentAssertions.sln.DotSettings b/FluentAssertions.sln.DotSettings
index 2db6662b1c..c52d714bf8 100644
--- a/FluentAssertions.sln.DotSettings
+++ b/FluentAssertions.sln.DotSettings
@@ -6,62 +6,80 @@
True
HINT
DO_NOT_SHOW
- <?xml version="1.0" encoding="utf-16"?><Profile name="Safe Cleanup"><CSArrangeThisQualifier>True</CSArrangeThisQualifier><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSUseAutoProperty>True</CSUseAutoProperty><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSCodeStyleAttributes ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeObjectCreation="True" ArrangeDefaultValue="True" ArrangeNamespaces="True" /><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><IDEA_SETTINGS><profile version="1.0">
+ <?xml version="1.0" encoding="utf-16"?><Profile name="Safe Cleanup"><CSArrangeThisQualifier>True</CSArrangeThisQualifier><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSUseAutoProperty>True</CSUseAutoProperty><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSCodeStyleAttributes ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeObjectCreation="True" ArrangeDefaultValue="True" ArrangeNamespaces="True" RemoveRedundantParentheses="True" /><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><IDEA_SETTINGS><profile version="1.0">
<option name="myName" value="Safe Cleanup" />
+ <inspection_tool class="ES6ShorthandObjectProperty" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="JSArrowFunctionBracesCanBeRemoved" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="JSPrimitiveTypeWrapperUsage" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="JSRemoveUnnecessaryParentheses" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="JSUnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="TypeScriptExplicitMemberType" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryContinueJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryLabelJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryLabelOnBreakStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryLabelOnContinueStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="UnnecessaryReturnJS" enabled="false" level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="WrongPropertyKeyValueDelimiter" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
</profile></IDEA_SETTINGS><RIDER_SETTINGS><profile>
<Language id="CSS">
- <Reformat>true</Reformat>
- <Rearrange>true</Rearrange>
+ <Reformat>false</Reformat>
+ <Rearrange>false</Rearrange>
</Language>
<Language id="EditorConfig">
- <Reformat>true</Reformat>
+ <Reformat>false</Reformat>
</Language>
<Language id="HTML">
- <OptimizeImports>true</OptimizeImports>
- <Reformat>true</Reformat>
- <Rearrange>true</Rearrange>
+ <Reformat>false</Reformat>
+ <Rearrange>false</Rearrange>
+ <OptimizeImports>false</OptimizeImports>
</Language>
<Language id="HTTP Request">
- <Reformat>true</Reformat>
+ <Reformat>false</Reformat>
</Language>
<Language id="Handlebars">
- <Reformat>true</Reformat>
+ <Reformat>false</Reformat>
</Language>
<Language id="Ini">
- <Reformat>true</Reformat>
+ <Reformat>false</Reformat>
</Language>
<Language id="JSON">
- <Reformat>true</Reformat>
+ <Reformat>false</Reformat>
</Language>
<Language id="Jade">
- <Reformat>true</Reformat>
+ <Reformat>false</Reformat>
</Language>
<Language id="JavaScript">
- <OptimizeImports>true</OptimizeImports>
- <Reformat>true</Reformat>
- <Rearrange>true</Rearrange>
+ <Reformat>false</Reformat>
+ <Rearrange>false</Rearrange>
+ <OptimizeImports>false</OptimizeImports>
</Language>
<Language id="Markdown">
- <Reformat>true</Reformat>
+ <Reformat>false</Reformat>
+ </Language>
+ <Language id="PowerShell">
+ <Reformat>false</Reformat>
</Language>
<Language id="Properties">
- <Reformat>true</Reformat>
+ <Reformat>false</Reformat>
</Language>
<Language id="RELAX-NG">
- <Reformat>true</Reformat>
+ <Reformat>false</Reformat>
</Language>
<Language id="SQL">
- <Reformat>true</Reformat>
+ <Reformat>false</Reformat>
+ </Language>
+ <Language id="VueExpr">
+ <Reformat>false</Reformat>
</Language>
<Language id="XML">
- <OptimizeImports>true</OptimizeImports>
- <Reformat>true</Reformat>
- <Rearrange>true</Rearrange>
+ <Reformat>false</Reformat>
+ <Rearrange>false</Rearrange>
+ <OptimizeImports>false</OptimizeImports>
</Language>
<Language id="yaml">
- <Reformat>true</Reformat>
+ <Reformat>false</Reformat>
</Language>
-</profile></RIDER_SETTINGS></Profile>
+</profile></RIDER_SETTINGS><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags></Profile>
Safe Cleanup
Required
Required
@@ -77,6 +95,9 @@
True
False
130
+ False
+ 1
+ 130
False
UseExplicitType
UseVarWhenEvident
diff --git a/Tests/.editorconfig b/Tests/.editorconfig
index cf27b53ce5..7fc6546234 100644
--- a/Tests/.editorconfig
+++ b/Tests/.editorconfig
@@ -146,4 +146,7 @@ dotnet_diagnostic.SA1615.severity = none
dotnet_diagnostic.SA1005.severity = suggestion
# ReSharper/Rider
-resharper_expression_is_always_null_highlighting=none
+resharper_expression_is_always_null_highlighting = none
+
+# ReSharper properties
+resharper_keep_user_linebreaks = true
From 454f16b54a88e2ebb5debbf7e40fab2937dfc147 Mon Sep 17 00:00:00 2001
From: Dennis
Date: Tue, 7 Feb 2023 11:35:24 +0100
Subject: [PATCH 05/98] Auto-formatted all code with some manual corrections
---
.../AggregateExceptionExtractor.cs | 2 +-
Src/FluentAssertions/AndWhichConstraint.cs | 3 +-
Src/FluentAssertions/AssertionExtensions.cs | 27 +-
Src/FluentAssertions/AssertionOptions.cs | 2 +-
.../CallerStatementBuilder.cs | 12 +-
.../MultiLineCommentParsingStrategy.cs | 2 +
.../QuotesParsingStrategy.cs | 1 +
.../SingleLineCommentParsingStrategy.cs | 1 +
Src/FluentAssertions/CallerIdentifier.cs | 17 +-
.../GenericCollectionAssertions.cs | 339 +++++++++++------
.../GenericDictionaryAssertions.cs | 117 ++++--
.../MaximumMatching/MaximumMatchingSolver.cs | 8 +-
.../Collections/StringCollectionAssertions.cs | 46 ++-
.../SubsequentOrderingAssertions.cs | 28 +-
Src/FluentAssertions/Common/Configuration.cs | 2 +
.../Common/DictionaryHelpers.cs | 1 +
.../Common/EnumerableExtensions.cs | 8 +-
.../Common/ExceptionExtensions.cs | 1 +
.../Common/ExpressionExtensions.cs | 8 +-
.../Common/FullFrameworkReflector.cs | 16 +-
Src/FluentAssertions/Common/Guard.cs | 16 +-
.../Common/ICollectionWrapper.cs | 21 +-
.../Common/IntegerExtensions.cs | 2 +-
Src/FluentAssertions/Common/MemberPath.cs | 10 +-
.../MemberPathSegmentEqualityComparer.cs | 9 +-
.../Common/MethodInfoExtensions.cs | 5 +-
.../Common/ObjectExtensions.cs | 8 +-
.../ReadOnlyNonGenericCollectionWrapper.cs | 18 +-
.../Common/StringExtensions.cs | 10 +-
.../Common/TimeOnlyExtensions.cs | 1 -
Src/FluentAssertions/Common/TypeExtensions.cs | 76 ++--
.../CustomAssertionAttribute.cs | 2 +-
.../Data/DataColumnAssertions.cs | 23 +-
.../Data/DataEquivalencyAssertionOptions.cs | 37 +-
.../Data/DataRowAssertions.cs | 34 +-
.../Data/DataSetAssertions.cs | 35 +-
.../Data/DataTableAssertions.cs | 41 +-
.../Data/IDataEquivalencyAssertionOptions.cs | 1 -
...DataColumnCollectionAssertionExtensions.cs | 7 +-
.../DataRowAssertionExtensions.cs | 2 -
.../DataRowCollectionAssertionExtensions.cs | 8 +-
.../DataSetAssertionExtensions.cs | 2 -
.../DataTableAssertionExtensions.cs | 2 -
.../DataTableCollectionAssertionExtensions.cs | 5 +-
.../Equivalency/Comparands.cs | 3 +-
.../EquivalencyAssertionOptions.cs | 7 +-
.../Equivalency/EquivalencyStep.cs | 6 +-
.../Equivalency/EquivalencyValidator.cs | 3 +
...llectionMemberAssertionOptionsDecorator.cs | 3 +-
.../Execution/CyclicReferenceDetector.cs | 2 +-
.../Equivalency/Execution/ObjectReference.cs | 4 +-
.../IEquivalencyAssertionOptions.cs | 1 -
.../IEquivalencyValidationContext.cs | 1 -
Src/FluentAssertions/Equivalency/IMember.cs | 1 -
.../Matching/MappedMemberMatchingRule.cs | 3 +-
.../Matching/MappedPathMatchingRule.cs | 6 +-
.../Matching/MustMatchByNameRule.cs | 6 +-
.../Matching/TryMatchByNameRule.cs | 5 +-
.../Equivalency/MemberFactory.cs | 5 +-
.../MultiDimensionalArrayEquivalencyStep.cs | 5 +-
Src/FluentAssertions/Equivalency/Node.cs | 2 +-
.../Ordering/ByteArrayOrderingRule.cs | 4 +-
.../Ordering/PathBasedOrderingRule.cs | 2 +
Src/FluentAssertions/Equivalency/Property.cs | 6 +-
.../ExcludeNonBrowsableMembersRule.cs | 6 +-
.../IncludeMemberByPathSelectionRule.cs | 4 +-
.../IncludeMemberByPredicateSelectionRule.cs | 4 +-
.../SelectMemberByPathSelectionRule.cs | 3 +-
...elfReferenceEquivalencyAssertionOptions.cs | 4 +-
.../Equivalency/Steps/AssertionContext.cs | 4 +-
.../Steps/AssertionRuleEquivalencyStep.cs | 9 +-
.../Equivalency/Steps/AutoConversionStep.cs | 12 +-
.../ConstraintCollectionEquivalencyStep.cs | 11 +-
.../Steps/ConstraintEquivalencyStep.cs | 15 +-
.../Steps/DataColumnEquivalencyStep.cs | 12 +-
.../Steps/DataRelationEquivalencyStep.cs | 8 +-
.../Steps/DataRowCollectionEquivalencyStep.cs | 30 +-
.../Steps/DataRowEquivalencyStep.cs | 37 +-
.../Steps/DataSetEquivalencyStep.cs | 68 ++--
.../Steps/DataTableEquivalencyStep.cs | 48 ++-
.../Steps/DictionaryEquivalencyStep.cs | 22 +-
.../Steps/DictionaryInterfaceInfo.cs | 1 +
.../Equivalency/Steps/EnumEqualityStep.cs | 13 +-
.../Steps/EnumerableEquivalencyStep.cs | 7 +-
.../Steps/EnumerableEquivalencyValidator.cs | 31 +-
...numerableEquivalencyValidatorExtensions.cs | 13 +-
.../Steps/EqualityComparerEquivalencyStep.cs | 3 +-
.../Steps/GenericDictionaryEquivalencyStep.cs | 5 +-
.../Steps/GenericEnumerableEquivalencyStep.cs | 15 +-
.../Steps/ReferenceEqualityEquivalencyStep.cs | 7 +-
.../Steps/RunAllUserStepsEquivalencyStep.cs | 3 +-
.../Steps/SimpleEqualityEquivalencyStep.cs | 3 +-
.../Steps/StringEqualityEquivalencyStep.cs | 6 +-
.../StructuralEqualityEquivalencyStep.cs | 20 +-
.../Steps/ValueTypeEquivalencyStep.cs | 9 +-
.../Steps/XAttributeEquivalencyStep.cs | 3 +-
.../Steps/XDocumentEquivalencyStep.cs | 3 +-
.../Steps/XElementEquivalencyStep.cs | 3 +-
.../Equivalency/Tracing/Tracer.cs | 2 +-
Src/FluentAssertions/EquivalencyPlan.cs | 4 +-
.../EventRaisingExtensions.cs | 7 +-
.../Events/EventAssertions.cs | 7 +-
Src/FluentAssertions/Events/EventMonitor.cs | 2 +
Src/FluentAssertions/Events/EventRecorder.cs | 3 +-
.../Execution/AssertionFailedException.cs | 2 -
.../Execution/AssertionScope.cs | 36 +-
.../Execution/CollectingAssertionStrategy.cs | 1 -
.../Execution/ContextDataItems.cs | 3 +-
.../Execution/ContinuationOfGiven.cs | 5 +-
.../Execution/DefaultAssertionStrategy.cs | 1 -
.../Execution/GivenSelectorExtensions.cs | 22 +-
.../Execution/LateBoundTestFramework.cs | 1 +
.../Execution/MessageBuilder.cs | 9 +-
.../Execution/NSpecFramework.cs | 1 +
.../Execution/TestFrameworkProvider.cs | 7 +-
.../Execution/XUnit2TestFramework.cs | 1 +
.../Extensions/FluentDateTimeExtensions.cs | 6 +-
.../AggregateExceptionValueFormatter.cs | 1 +
.../Formatting/AttributeBasedFormatter.cs | 16 +-
.../Formatting/DateOnlyValueFormatter.cs | 1 -
.../DateTimeOffsetValueFormatter.cs | 10 +-
.../Formatting/DefaultValueFormatter.cs | 4 +-
.../Formatting/DictionaryValueFormatter.cs | 2 +
.../Formatting/EnumValueFormatter.cs | 1 +
.../Formatting/EnumerableExtensions.cs | 2 +-
.../Formatting/EnumerableValueFormatter.cs | 1 +
.../Formatting/FormattedObjectGraph.cs | 4 +-
Src/FluentAssertions/Formatting/Formatter.cs | 5 +-
.../Formatting/FormattingOptions.cs | 2 +-
.../MultidimensionalArrayFormatter.cs | 4 +-
...PredicateLambdaExpressionValueFormatter.cs | 2 +-
.../Formatting/TimeOnlyValueFormatter.cs | 1 -
.../Formatting/TimeSpanValueFormatter.cs | 5 +-
.../Formatting/ValueFormatterAttribute.cs | 2 +-
.../Numeric/ComparableTypeAssertions.cs | 10 +-
.../Numeric/DecimalAssertions.cs | 2 +-
.../Numeric/NullableDecimalAssertions.cs | 2 +-
.../Numeric/NumericAssertions.cs | 37 +-
.../NumericAssertionsExtensions.cs | 188 +++++++---
.../ObjectAssertionsExtensions.cs | 6 +-
.../Primitives/BooleanAssertions.cs | 2 +-
.../Primitives/DateOnlyAssertions.cs | 7 +-
.../Primitives/DateTimeAssertions.cs | 14 +-
.../Primitives/DateTimeOffsetAssertions.cs | 37 +-
.../DateTimeOffsetRangeAssertions.cs | 9 +-
.../Primitives/DateTimeRangeAssertions.cs | 9 +-
.../Primitives/EnumAssertions.cs | 19 +-
.../HttpResponseMessageAssertions.cs | 3 +-
.../Primitives/NegatedStringStartValidator.cs | 1 +
.../Primitives/NullableDateOnlyAssertions.cs | 1 -
.../Primitives/NullableTimeOnlyAssertions.cs | 1 -
.../Primitives/ObjectAssertions.cs | 1 +
.../Primitives/ReferenceTypeAssertions.cs | 6 +-
.../Primitives/SimpleTimeSpanAssertions.cs | 8 +-
.../Primitives/StringAssertions.cs | 85 +++--
.../Primitives/StringEqualityValidator.cs | 7 +-
.../Primitives/StringStartValidator.cs | 1 +
.../Primitives/StringValidator.cs | 6 +-
.../StringWildcardMatchingValidator.cs | 9 +-
.../Primitives/TimeOnlyAssertions.cs | 9 +-
.../Primitives/TimeSpanPredicate.cs | 5 +-
.../Specialized/AssemblyAssertions.cs | 15 +-
.../Specialized/AsyncFunctionAssertions.cs | 11 +-
.../Specialized/DelegateAssertions.cs | 11 +-
.../Specialized/DelegateAssertionsBase.cs | 4 +-
.../Specialized/ExceptionAssertions.cs | 8 +-
.../Specialized/ExecutionTime.cs | 2 +
.../Specialized/ExecutionTimeAssertions.cs | 46 ++-
.../Specialized/FunctionAssertionHelpers.cs | 9 +-
.../Specialized/FunctionAssertions.cs | 10 +-
.../GenericAsyncFunctionAssertions.cs | 12 +-
.../TaskCompletionSourceAssertions.cs | 4 +-
.../Types/MethodBaseAssertions.cs | 3 +-
.../Types/MethodInfoAssertions.cs | 38 +-
.../Types/MethodInfoSelector.cs | 15 +-
.../Types/MethodInfoSelectorAssertions.cs | 20 +-
.../Types/PropertyInfoAssertions.cs | 85 ++---
.../Types/PropertyInfoSelector.cs | 2 +-
.../Types/PropertyInfoSelectorAssertions.cs | 6 +-
Src/FluentAssertions/Types/TypeAssertions.cs | 14 +-
Src/FluentAssertions/Types/TypeSelector.cs | 5 +-
.../Types/TypeSelectorAssertions.cs | 35 +-
Src/FluentAssertions/Xml/Equivalency/Node.cs | 5 +-
.../Xml/Equivalency/XmlIterator.cs | 1 +
.../Xml/Equivalency/XmlReaderValidator.cs | 7 +-
.../Xml/XDocumentAssertions.cs | 18 +-
.../Xml/XElementAssertions.cs | 2 +-
.../FluentAssertions/net47.verified.txt | 4 +-
.../FluentAssertions/net6.0.verified.txt | 4 +-
.../netcoreapp2.1.verified.txt | 4 +-
.../netcoreapp3.0.verified.txt | 4 +-
.../netstandard2.0.verified.txt | 4 +-
.../netstandard2.1.verified.txt | 4 +-
Tests/Benchmarks/CheckIfMemberIsBrowsable.cs | 2 +-
Tests/Benchmarks/LargeDataTableEquivalency.cs | 9 +-
Tests/Benchmarks/LargeObjectGraph.cs | 6 +-
Tests/Benchmarks/Program.cs | 8 +-
.../UsersOfGetClosedGenericInterfaces.cs | 45 ++-
.../BasicSpecs.cs | 2 +-
.../CollectionSpecs.cs | 175 +++++----
.../CyclicReferencesSpecs.cs | 163 ++++++--
.../DataColumnSpecs.cs | 5 +-
.../DataRelationSpecs.cs | 16 +-
.../DataRowSpecs.cs | 38 +-
.../DataSetSpecs.cs | 92 +++--
.../DataSpecs.cs | 60 +--
.../DataTableSpecs.cs | 145 +++++---
.../DictionarySpecs.cs | 84 +++--
.../EnumSpecs.cs | 4 +-
.../ExtensibilitySpecs.cs | 37 +-
.../MemberConversionSpecs.cs | 2 +-
.../MemberLessObjectsSpecs.cs | 4 +-
.../SelectionRulesSpecs.cs | 38 +-
.../TestTypes.cs | 19 +-
.../TupleSpecs.cs | 4 +-
.../TypedDataSetSpecs.cs | 15 +-
.../TypedDataTableSpecs.cs | 20 +-
.../XmlSpecs.cs | 5 +-
.../AssertionExtensions.cs | 1 -
.../AssertionExtensionsSpecs.cs | 5 +-
.../AssertionOptionsSpecs.cs | 16 +-
.../CollectionAssertionSpecs.AllSatisfy.cs | 8 +-
.../CollectionAssertionSpecs.BeEmpty.cs | 2 +-
...CollectionAssertionSpecs.BeEquivalentTo.cs | 9 +-
...ectionAssertionSpecs.BeInAscendingOrder.cs | 78 ++--
...ctionAssertionSpecs.BeInDescendingOrder.cs | 73 ++--
.../CollectionAssertionSpecs.BeSubsetOf.cs | 2 +-
.../CollectionAssertionSpecs.Contain.cs | 6 +-
...ctionAssertionSpecs.ContainEquivalentOf.cs | 31 +-
...ssertionSpecs.ContainInConsecutiveOrder.cs | 14 +-
...CollectionAssertionSpecs.ContainInOrder.cs | 11 +-
...AssertionSpecs.ContainItemsAssignableTo.cs | 15 +-
.../CollectionAssertionSpecs.ContainSingle.cs | 13 +-
.../CollectionAssertionSpecs.EndWith.cs | 18 +-
.../CollectionAssertionSpecs.Equal.cs | 20 +-
.../CollectionAssertionSpecs.HaveCount.cs | 13 +-
...tionAssertionSpecs.HaveCountGreaterThan.cs | 9 +-
...tionSpecs.HaveCountGreaterThanOrEqualTo.cs | 12 +-
...lectionAssertionSpecs.HaveCountLessThan.cs | 6 +-
...sertionSpecs.HaveCountLessThanOrEqualTo.cs | 12 +-
.../CollectionAssertionSpecs.HaveSameCount.cs | 3 +-
...ctionAssertionSpecs.OnlyHaveUniqueItems.cs | 3 +-
.../CollectionAssertionSpecs.Satisfy.cs | 32 +-
...ctionAssertionSpecs.SatisfyRespectively.cs | 28 +-
.../CollectionAssertionSpecs.StartWith.cs | 18 +-
.../Collections/CollectionAssertionSpecs.cs | 14 +-
.../DataColumnCollectionAssertionSpecs.cs | 9 +-
.../Data/DataRowCollectionAssertionSpecs.cs | 62 ++--
.../Data/DataTableCollectionAssertionSpecs.cs | 7 +-
...ectionAssertionOfStringSpecs.AllSatisfy.cs | 4 +-
...GenericCollectionAssertionOfStringSpecs.cs | 63 ++--
.../GenericDictionaryAssertionSpecs.cs | 350 +++++++++++-------
.../Common/TimeSpanExtensions.cs | 2 +
.../ConfigurationSpecs.cs | 4 +-
.../CulturedFactAttributeDiscoverer.cs | 6 +-
.../CulturedTheoryAttribute.cs | 3 +-
.../CulturedTheoryAttributeDiscoverer.cs | 20 +-
.../CulturedXunitTestCase.cs | 24 +-
.../CulturedXunitTheoryTestCase.cs | 22 +-
.../CulturedXunitTheoryTestCaseRunner.cs | 17 +-
.../Events/EventAssertionSpecs.cs | 55 +--
.../AsyncFunctionExceptionAssertionSpecs.cs | 47 ++-
.../Exceptions/ExceptionAssertionSpecs.cs | 17 +-
.../FunctionExceptionAssertionSpecs.cs | 30 +-
.../Exceptions/InnerExceptionSpecs.cs | 32 +-
.../Exceptions/MiscellaneousExceptionSpecs.cs | 4 +-
.../Exceptions/NotThrowSpecs.cs | 17 +-
.../Exceptions/OuterExceptionSpecs.cs | 21 +-
.../AssertionScope.ChainingApiSpecs.cs | 11 +-
.../AssertionScope.ContextDataSpecs.cs | 6 +-
.../AssertionScope.MessageFormatingSpecs.cs | 8 +-
.../Execution/AssertionScopeSpecs.cs | 5 +-
.../Execution/GivenSelectorSpecs.cs | 6 +-
.../Execution/TestFrameworkProviderTests.cs | 4 +
.../Extensions/FluentDateTimeSpecs.cs | 12 +-
.../Extensions/ObjectExtensionsSpecs.cs | 26 +-
.../DateTimeOffsetValueFormatterSpecs.cs | 8 +-
.../Formatting/FormatterSpecs.cs | 52 +--
.../MultidimensionalArrayFormatterSpecs.cs | 16 +-
...cateLambdaExpressionValueFormatterSpecs.cs | 3 +-
.../Formatting/TimeSpanFormatterSpecs.cs | 3 +-
.../Numeric/ComparableSpecs.cs | 5 +-
.../Numeric/NumericAssertionSpecs.cs | 3 +-
.../NumericDifferenceAssertionsSpecs.cs | 111 ++++--
.../Primitives/BooleanAssertionSpecs.cs | 3 +-
.../Primitives/DateOnlyAssertionSpecs.cs | 4 +-
.../Primitives/DateTimeAssertionSpecs.cs | 243 ++++++------
.../DateTimeOffsetAssertionSpecs.cs | 307 ++++++++-------
.../Primitives/EnumAssertionSpecs.cs | 12 +-
.../Primitives/GuidAssertionSpecs.cs | 3 +-
.../NullableBooleanAssertionSpecs.cs | 6 +-
.../Primitives/NullableGuidAssertionSpecs.cs | 6 +-
.../NullableSimpleTimeSpanAssertionSpecs.cs | 6 +-
.../Primitives/ObjectAssertionSpecs.cs | 138 ++++---
.../ReferenceTypeAssertionsSpecs.cs | 44 ++-
.../SimpleTimeSpanAssertionSpecs.cs | 27 +-
.../Primitives/StringAssertionSpecs.Be.cs | 3 +-
.../StringAssertionSpecs.BeEquivalentTo.cs | 6 +-
.../StringAssertionSpecs.BeOneOf.cs | 3 +-
.../StringAssertionSpecs.Contain.cs | 48 ++-
.../StringAssertionSpecs.ContainAll.cs | 24 +-
.../StringAssertionSpecs.ContainAny.cs | 24 +-
...tringAssertionSpecs.ContainEquivalentOf.cs | 75 ++--
.../StringAssertionSpecs.EndWith.cs | 4 +-
...tringAssertionSpecs.EndWithEquivalentOf.cs | 7 +-
.../Primitives/StringAssertionSpecs.Match.cs | 9 +-
.../StringAssertionSpecs.MatchEquivalentOf.cs | 14 +-
.../StringAssertionSpecs.MatchRegex.cs | 52 +--
.../StringAssertionSpecs.StartWith.cs | 7 +-
...ingAssertionSpecs.StartWithEquivalentOf.cs | 14 +-
.../Primitives/StringAssertionSpecs.cs | 3 -
.../Primitives/StringComparisonSpecs.cs | 8 +-
.../Primitives/TimeOnlyAssertionSpecs.cs | 85 +++--
.../Specialized/AssemblyAssertionSpecs.cs | 7 +-
.../ExecutionTimeAssertionsSpecs.cs | 9 +-
.../Specialized/TaskAssertionSpecs.cs | 9 +-
.../TaskCompletionSourceAssertionSpecs.cs | 11 +-
.../Specialized/TaskOfTAssertionSpecs.cs | 13 +-
.../Streams/StreamAssertionSpecs.cs | 3 +-
.../TypeEnumerableExtensionsSpecs.cs | 23 +-
.../Types/MethodBaseAssertionSpecs.cs | 65 ++--
.../Types/MethodInfoAssertionSpecs.cs | 99 +++--
.../Types/MethodInfoSelectorAssertionSpecs.cs | 85 +++--
.../Types/MethodInfoSelectorSpecs.cs | 35 +-
.../Types/PropertyInfoAssertionSpecs.cs | 109 +++---
.../PropertyInfoSelectorAssertionSpecs.cs | 52 +--
.../Types/PropertyInfoSelectorSpecs.cs | 48 ++-
.../Types/TypeAssertionSpecs.Be.cs | 11 +-
.../TypeAssertionSpecs.BeAssignableTo.cs | 1 +
.../TypeAssertionSpecs.BeDecoratedWith.cs | 10 +-
...AssertionSpecs.BeDecoratedWithOrInherit.cs | 10 +-
.../TypeAssertionSpecs.HaveConstructor.cs | 7 +-
...peAssertionSpecs.HaveDefaultConstructor.cs | 16 +-
...ionSpecs.HaveExplicitConversionOperator.cs | 4 +-
.../TypeAssertionSpecs.HaveExplicitMethod.cs | 6 +-
...TypeAssertionSpecs.HaveExplicitProperty.cs | 6 +-
...ionSpecs.HaveImplicitConversionOperator.cs | 4 +-
.../Types/TypeAssertionSpecs.HaveIndexer.cs | 4 +-
.../Types/TypeAssertionSpecs.HaveMethod.cs | 6 +-
.../Types/TypeAssertionSpecs.HaveProperty.cs | 8 +-
.../Types/TypeAssertionSpecs.cs | 80 ++--
.../Types/TypeExtensionsSpecs.cs | 50 ++-
.../Types/TypeSelectorAssertionSpecs.cs | 19 +-
.../Types/TypeSelectorSpecs.cs | 29 +-
.../UIFactsDefinition.cs | 4 +-
.../Xml/XAttributeAssertionSpecs.cs | 13 +-
.../Xml/XAttributeFormatterSpecs.cs | 1 -
.../Xml/XDocumentAssertionSpecs.cs | 102 +++--
.../Xml/XDocumentFormatterSpecs.cs | 1 -
.../Xml/XElementAssertionSpecs.cs | 90 +++--
.../Xml/XElementFormatterSpecs.cs | 1 -
.../Xml/XmlElementAssertionSpecs.cs | 35 +-
.../Xml/XmlNodeAssertionSpecs.cs | 57 ++-
.../Xml/XmlNodeFormatterSpecs.cs | 1 -
354 files changed, 4640 insertions(+), 2867 deletions(-)
diff --git a/Src/FluentAssertions/AggregateExceptionExtractor.cs b/Src/FluentAssertions/AggregateExceptionExtractor.cs
index 9777f6361c..b94e03e7fc 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 ? new[] { exception } : Enumerable.Empty();
}
return GetExtractedExceptions(actualException);
diff --git a/Src/FluentAssertions/AndWhichConstraint.cs b/Src/FluentAssertions/AndWhichConstraint.cs
index 201e32c89d..a30126ba2f 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.Formatting;
@@ -44,7 +43,7 @@ private static TMatchedElement SingleOrDefault(
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}";
Services.ThrowException(message);
}
diff --git a/Src/FluentAssertions/AssertionExtensions.cs b/Src/FluentAssertions/AssertionExtensions.cs
index a4638c1cb1..d16c01d5d7 100644
--- a/Src/FluentAssertions/AssertionExtensions.cs
+++ b/Src/FluentAssertions/AssertionExtensions.cs
@@ -13,9 +13,6 @@
using FluentAssertions.Collections;
using FluentAssertions.Common;
using FluentAssertions.Data;
-#if !NETSTANDARD2_0
-using FluentAssertions.Events;
-#endif
using FluentAssertions.Numeric;
using FluentAssertions.Primitives;
using FluentAssertions.Reflection;
@@ -24,6 +21,9 @@
using FluentAssertions.Types;
using FluentAssertions.Xml;
using JetBrains.Annotations;
+#if !NETSTANDARD2_0
+using FluentAssertions.Events;
+#endif
namespace FluentAssertions;
@@ -140,7 +140,7 @@ public static ExecutionTime ExecutionTime(this Action action, StartTimer createT
{
createTimer ??= () => new StopwatchTimer();
- return new(action, createTimer);
+ return new ExecutionTime(action, createTimer);
}
///
@@ -154,7 +154,7 @@ public static ExecutionTime ExecutionTime(this Action action, StartTimer createT
[MustUseReturnValue /* do not use Pure because this method executes the action before returning to the caller */]
public static ExecutionTime ExecutionTime(this Func action)
{
- return new(action, () => new StopwatchTimer());
+ return new ExecutionTime(action, () => new StopwatchTimer());
}
///
@@ -359,7 +359,8 @@ public static StringCollectionAssertions Should(this IEnumerable @this)
/// current .
///
[Pure]
- public static GenericDictionaryAssertions, TKey, TValue> Should(this IDictionary actualValue)
+ public static GenericDictionaryAssertions, TKey, TValue> Should(
+ this IDictionary actualValue)
{
return new GenericDictionaryAssertions, TKey, TValue>(actualValue);
}
@@ -369,7 +370,8 @@ public static GenericDictionaryAssertions, TKey, TValu
/// current of .
///
[Pure]
- public static GenericDictionaryAssertions>, TKey, TValue> Should(this IEnumerable> actualValue)
+ public static GenericDictionaryAssertions>, TKey, TValue> Should(
+ this IEnumerable> actualValue)
{
return new GenericDictionaryAssertions>, TKey, TValue>(actualValue);
}
@@ -379,7 +381,8 @@ public static GenericDictionaryAssertions
/// current .
///
[Pure]
- public static GenericDictionaryAssertions Should(this TCollection actualValue)
+ public static GenericDictionaryAssertions Should(
+ this TCollection actualValue)
where TCollection : IEnumerable>
{
return new GenericDictionaryAssertions(actualValue);
@@ -466,7 +469,6 @@ public static NullableDateTimeOffsetAssertions Should(this DateTimeOffset? actua
}
#if NET6_0_OR_GREATER
-
///
/// Returns an object that can be used to assert the
/// current .
@@ -921,7 +923,6 @@ public static IMonitor Monitor(this T eventSource, Func utcNow =
#endif
#if NET6_0_OR_GREATER
-
///
/// Returns a object that can be used to assert the
/// current .
@@ -981,8 +982,7 @@ public static void Should(this DateTimeOffsetAssertions
[Obsolete("You are asserting the 'AndConstraint' itself. Remove the 'Should()' method directly following 'And'", error: true)]
public static void Should(this DateOnlyAssertions _)
@@ -1091,7 +1091,8 @@ public static void Should(this DateTimeOffsetRangeAssertions CloneDefaults()
{
- return new(defaults);
+ return new EquivalencyAssertionOptions(defaults);
}
internal static TOptions CloneDefaults(Func predicate)
diff --git a/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs b/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs
index 225b899e6c..af280faf83 100644
--- a/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs
+++ b/Src/FluentAssertions/CallerIdentification/CallerStatementBuilder.cs
@@ -13,6 +13,7 @@ internal class CallerStatementBuilder
internal CallerStatementBuilder()
{
statement = new StringBuilder();
+
priorityOrderedParsingStrategies = new List
{
new QuotesParsingStrategy(),
@@ -28,19 +29,22 @@ internal CallerStatementBuilder()
internal void Append(string symbols)
{
using var symbolEnumerator = symbols.GetEnumerator();
+
while (symbolEnumerator.MoveNext() && parsingState != ParsingState.Done)
{
var hasParsingStrategyWaitingForEndContext = priorityOrderedParsingStrategies
.Any(s => s.IsWaitingForContextEnd());
parsingState = ParsingState.InProgress;
+
foreach (var parsingStrategy in
- priorityOrderedParsingStrategies
- .SkipWhile(parsingStrategy =>
- hasParsingStrategyWaitingForEndContext
- && !parsingStrategy.IsWaitingForContextEnd()))
+ priorityOrderedParsingStrategies
+ .SkipWhile(parsingStrategy =>
+ hasParsingStrategyWaitingForEndContext
+ && !parsingStrategy.IsWaitingForContextEnd()))
{
parsingState = parsingStrategy.Parse(symbolEnumerator.Current, statement);
+
if (parsingState != ParsingState.InProgress)
{
break;
diff --git a/Src/FluentAssertions/CallerIdentification/MultiLineCommentParsingStrategy.cs b/Src/FluentAssertions/CallerIdentification/MultiLineCommentParsingStrategy.cs
index 6e22a04799..a614631307 100644
--- a/Src/FluentAssertions/CallerIdentification/MultiLineCommentParsingStrategy.cs
+++ b/Src/FluentAssertions/CallerIdentification/MultiLineCommentParsingStrategy.cs
@@ -12,6 +12,7 @@ public ParsingState Parse(char symbol, StringBuilder statement)
if (isCommentContext)
{
var isEndOfMultilineComment = symbol is '/' && commentContextPreviousChar is '*';
+
if (isEndOfMultilineComment)
{
isCommentContext = false;
@@ -29,6 +30,7 @@ public ParsingState Parse(char symbol, StringBuilder statement)
symbol is '*'
&& statement.Length > 0
&& statement[^1] is '/';
+
if (isStartOfMultilineComment)
{
statement.Remove(statement.Length - 1, 1);
diff --git a/Src/FluentAssertions/CallerIdentification/QuotesParsingStrategy.cs b/Src/FluentAssertions/CallerIdentification/QuotesParsingStrategy.cs
index 85991ead02..a988bb4c79 100644
--- a/Src/FluentAssertions/CallerIdentification/QuotesParsingStrategy.cs
+++ b/Src/FluentAssertions/CallerIdentification/QuotesParsingStrategy.cs
@@ -26,6 +26,7 @@ public ParsingState Parse(char symbol, StringBuilder statement)
else
{
isQuoteContext = true;
+
if (IsVerbatim(statement))
{
isQuoteEscapeSymbol = '"';
diff --git a/Src/FluentAssertions/CallerIdentification/SingleLineCommentParsingStrategy.cs b/Src/FluentAssertions/CallerIdentification/SingleLineCommentParsingStrategy.cs
index 434e1c3b0e..9c8e86196f 100644
--- a/Src/FluentAssertions/CallerIdentification/SingleLineCommentParsingStrategy.cs
+++ b/Src/FluentAssertions/CallerIdentification/SingleLineCommentParsingStrategy.cs
@@ -14,6 +14,7 @@ public ParsingState Parse(char symbol, StringBuilder statement)
}
var doesSymbolStartComment = symbol is '/' && statement.Length > 0 && statement[^1] is '/';
+
if (!doesSymbolStartComment)
{
return ParsingState.InProgress;
diff --git a/Src/FluentAssertions/CallerIdentifier.cs b/Src/FluentAssertions/CallerIdentifier.cs
index 91bceb00bc..5ef1a91728 100644
--- a/Src/FluentAssertions/CallerIdentifier.cs
+++ b/Src/FluentAssertions/CallerIdentifier.cs
@@ -87,13 +87,13 @@ public StackFrameReference()
int firstUserCodeFrameIndex = 0;
- while ((firstUserCodeFrameIndex < allStackFrames.Length)
- && IsCurrentAssembly(allStackFrames[firstUserCodeFrameIndex]))
+ while (firstUserCodeFrameIndex < allStackFrames.Length
+ && IsCurrentAssembly(allStackFrames[firstUserCodeFrameIndex]))
{
firstUserCodeFrameIndex++;
}
- SkipStackFrameCount = allStackFrames.Length - firstUserCodeFrameIndex + 1;
+ SkipStackFrameCount = (allStackFrames.Length - firstUserCodeFrameIndex) + 1;
previousReference = StartStackSearchAfterStackFrame.Value;
StartStackSearchAfterStackFrame.Value = this;
@@ -172,6 +172,7 @@ private static string ExtractVariableNameFrom(StackFrame frame)
if (!string.IsNullOrEmpty(statement))
{
Logger(statement);
+
if (!IsBooleanLiteral(statement) && !IsNumeric(statement) && !IsStringLiteral(statement) &&
!StartsWithNewKeyword(statement))
{
@@ -187,7 +188,7 @@ private static string GetSourceCodeStatementFrom(StackFrame frame)
string fileName = frame.GetFileName();
int expectedLineNumber = frame.GetFileLineNumber();
- if (string.IsNullOrEmpty(fileName) || (expectedLineNumber == 0))
+ if (string.IsNullOrEmpty(fileName) || expectedLineNumber == 0)
{
return null;
}
@@ -204,9 +205,9 @@ private static string GetSourceCodeStatementFrom(StackFrame frame)
}
return currentLine == expectedLineNumber
- && line != null
- ? GetSourceCodeStatementFrom(frame, reader, line)
- : null;
+ && line != null
+ ? GetSourceCodeStatementFrom(frame, reader, line)
+ : null;
}
catch
{
@@ -218,12 +219,14 @@ private static string GetSourceCodeStatementFrom(StackFrame frame)
private static string GetSourceCodeStatementFrom(StackFrame frame, StreamReader reader, string line)
{
int column = frame.GetFileColumnNumber();
+
if (column > 0)
{
line = line.Substring(Math.Min(column - 1, line.Length - 1));
}
var sb = new CallerStatementBuilder();
+
do
{
sb.Append(line);
diff --git a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
index 63d234c038..51c472e595 100644
--- a/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
+++ b/Src/FluentAssertions/Collections/GenericCollectionAssertions.cs
@@ -15,8 +15,7 @@
namespace FluentAssertions.Collections;
[DebuggerNonUserCode]
-public class GenericCollectionAssertions :
- GenericCollectionAssertions, T, GenericCollectionAssertions>
+public class GenericCollectionAssertions : GenericCollectionAssertions, T, GenericCollectionAssertions>
{
public GenericCollectionAssertions(IEnumerable actualValue)
: base(actualValue)
@@ -25,8 +24,8 @@ public GenericCollectionAssertions(IEnumerable actualValue)
}
[DebuggerNonUserCode]
-public class GenericCollectionAssertions :
- GenericCollectionAssertions>
+public class GenericCollectionAssertions
+ : GenericCollectionAssertions>
where TCollection : IEnumerable
{
public GenericCollectionAssertions(TCollection actualValue)
@@ -38,13 +37,12 @@ public GenericCollectionAssertions(TCollection actualValue)
#pragma warning disable CS0659 // Ignore not overriding Object.GetHashCode()
#pragma warning disable CA1065 // Ignore throwing NotSupportedException from Equals
[DebuggerNonUserCode]
-public class GenericCollectionAssertions :
- ReferenceTypeAssertions
+public class GenericCollectionAssertions : ReferenceTypeAssertions
where TCollection : IEnumerable
where TAssertions : GenericCollectionAssertions
{
public GenericCollectionAssertions(TCollection actualValue)
- : base(actualValue)
+ : base(actualValue)
{
}
@@ -64,12 +62,14 @@ 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(string because = "",
+ params object[] becauseArgs)
{
bool success = Execute.Assertion
.BecauseOf(because, becauseArgs)
.ForCondition(Subject is not null)
- .FailWith("Expected type to be {0}{reason}, but found {context:the collection} is .", typeof(TExpectation).FullName);
+ .FailWith("Expected type to be {0}{reason}, but found {context:the collection} is .",
+ typeof(TExpectation).FullName);
IEnumerable matches = new TExpectation[0];
@@ -209,12 +209,14 @@ 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(string because = "",
+ params object[] becauseArgs)
{
bool success = Execute.Assertion
.BecauseOf(because, becauseArgs)
.ForCondition(Subject is not null)
- .FailWith("Expected type to be {0}{reason}, but found {context:collection} is .", typeof(TExpectation).FullName);
+ .FailWith("Expected type to be {0}{reason}, but found {context:collection} is .",
+ typeof(TExpectation).FullName);
IEnumerable matches = new TExpectation[0];
@@ -355,13 +357,16 @@ public AndConstraint BeEquivalentTo(IEnumerable> options = config(AssertionOptions.CloneDefaults()).AsCollection();
+ EquivalencyAssertionOptions> options =
+ config(AssertionOptions.CloneDefaults()).AsCollection();
- var context = new EquivalencyValidationContext(Node.From>(() => AssertionScope.Current.CallerIdentity), options)
- {
- Reason = new Reason(because, becauseArgs),
- TraceWriter = options.TraceWriter,
- };
+ var context =
+ new EquivalencyValidationContext(Node.From>(() => AssertionScope.Current.CallerIdentity),
+ options)
+ {
+ Reason = new Reason(because, becauseArgs),
+ TraceWriter = options.TraceWriter,
+ };
var comparands = new Comparands
{
@@ -419,7 +424,9 @@ public AndConstraint> BeInAscendingOrder> BeInAscendingOrder(
IComparer comparer, string because = "", params object[] becauseArgs)
{
- Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer.");
+ Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer),
+ "Cannot assert collection ordering without specifying a comparer.");
+
return BeInOrder(comparer, SortOrder.Ascending, because, becauseArgs);
}
@@ -445,9 +452,12 @@ public AndConstraint> BeInAscendingOrder(
///
/// is .
public AndConstraint> BeInAscendingOrder(
- Expression> propertyExpression, IComparer comparer, string because = "", params object[] becauseArgs)
+ Expression> propertyExpression, IComparer comparer, string because = "",
+ params object[] becauseArgs)
{
- Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer.");
+ Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer),
+ "Cannot assert collection ordering without specifying a comparer.");
+
return BeOrderedBy(propertyExpression, comparer, SortOrder.Ascending, because, becauseArgs);
}
@@ -487,7 +497,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, string because = "",
+ params object[] becauseArgs)
{
return BeInOrder(Comparer.Create((x, y) => comparison(x, y)), SortOrder.Ascending, because, becauseArgs);
}
@@ -536,7 +547,9 @@ public AndConstraint> BeInDescendingOrder> BeInDescendingOrder(
IComparer comparer, string because = "", params object[] becauseArgs)
{
- Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer.");
+ Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer),
+ "Cannot assert collection ordering without specifying a comparer.");
+
return BeInOrder(comparer, SortOrder.Descending, because, becauseArgs);
}
@@ -562,9 +575,12 @@ public AndConstraint> BeInDescendingOrder(
///
/// is .
public AndConstraint> BeInDescendingOrder(
- Expression> propertyExpression, IComparer comparer, string because = "", params object[] becauseArgs)
+ Expression> propertyExpression, IComparer comparer, string because = "",
+ params object[] becauseArgs)
{
- Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer.");
+ Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer),
+ "Cannot assert collection ordering without specifying a comparer.");
+
return BeOrderedBy(propertyExpression, comparer, SortOrder.Descending, because, becauseArgs);
}
@@ -604,7 +620,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, string because = "",
+ params object[] becauseArgs)
{
return BeInOrder(Comparer.Create((x, y) => comparison(x, y)), SortOrder.Descending, because, becauseArgs);
}
@@ -647,7 +664,8 @@ public AndConstraint BeNullOrEmpty(string because = "", params obje
public AndConstraint BeSubsetOf(IEnumerable expectedSuperset, string because = "",
params object[] becauseArgs)
{
- Guard.ThrowIfArgumentIsNull(expectedSuperset, nameof(expectedSuperset), "Cannot verify a subset against a collection.");
+ Guard.ThrowIfArgumentIsNull(expectedSuperset, nameof(expectedSuperset),
+ "Cannot verify a subset against a collection.");
Execute.Assertion
.BecauseOf(because, becauseArgs)
@@ -688,6 +706,7 @@ public AndWhichConstraint Contain(T expected, string because = "
if (success)
{
ICollection collection = Subject.ConvertOrCastToCollection();
+
Execute.Assertion
.BecauseOf(because, becauseArgs)
.ForCondition(collection.Contains(expected))
@@ -711,7 +730,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 = "", params object[] becauseArgs)
+ public AndWhichConstraint Contain(Expression> predicate, string because = "",
+ params object[] becauseArgs)
{
Guard.ThrowIfArgumentIsNull(predicate);
@@ -766,6 +786,7 @@ public AndConstraint Contain(IEnumerable expected, string becaus
if (success)
{
IEnumerable missingItems = expectedObjects.Except(Subject);
+
if (missingItems.Any())
{
if (expectedObjects.Count > 1)
@@ -835,7 +856,8 @@ public AndWhichConstraint ContainEquivalentOf(TExp
/// Zero or more objects to format using the placeholders in .
///
/// is .
- public AndWhichConstraint ContainEquivalentOf(TExpectation expectation, Func,
+ public AndWhichConstraint ContainEquivalentOf(TExpectation expectation,
+ Func,
EquivalencyAssertionOptions> config, string because = "", params object[] becauseArgs)
{
Guard.ThrowIfArgumentIsNull(config);
@@ -854,11 +876,13 @@ public AndWhichConstraint ContainEquivalentOf(TExp
foreach (T actualItem in Subject)
{
- var context = new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity), options)
- {
- Reason = new Reason(because, becauseArgs),
- TraceWriter = options.TraceWriter
- };
+ var context =
+ new EquivalencyValidationContext(Node.From(() => AssertionScope.Current.CallerIdentity),
+ options)
+ {
+ Reason = new Reason(because, becauseArgs),
+ TraceWriter = options.TraceWriter
+ };
var comparands = new Comparands
{
@@ -870,6 +894,7 @@ public AndWhichConstraint ContainEquivalentOf(TExp
new EquivalencyValidator().AssertEquality(comparands, context);
string[] failures = scope.Discard();
+
if (!failures.Any())
{
return new AndWhichConstraint((TAssertions)this, actualItem);
@@ -1074,12 +1099,14 @@ public AndWhichConstraint ContainSingle(string because = "", par
if (success)
{
ICollection actualItems = Subject.ConvertOrCastToCollection();
+
switch (actualItems.Count)
{
case 0: // Fail, Collection is empty
Execute.Assertion
.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();
@@ -1088,6 +1115,7 @@ public AndWhichConstraint ContainSingle(string because = "", par
Execute.Assertion
.BecauseOf(because, becauseArgs)
.FailWith("Expected {context:collection} to contain a single item{reason}, but found {0}.", Subject);
+
break;
}
}
@@ -1125,6 +1153,7 @@ public AndWhichConstraint ContainSingle(Expression
if (success)
{
ICollection actualItems = Subject.ConvertOrCastToCollection();
+
Execute.Assertion
.ForCondition(actualItems.Any())
.BecauseOf(because, becauseArgs)
@@ -1132,20 +1161,24 @@ public AndWhichConstraint ContainSingle(Expression
matches = actualItems.Where(predicate.Compile()).ToArray();
int count = matches.Length;
- switch (count)
+
+ if (count == 0)
{
- case 0:
- Execute.Assertion
- .BecauseOf(because, becauseArgs)
- .FailWith(expectationPrefix + "but no such item was found.", predicate);
- break;
- case > 1:
- Execute.Assertion
- .BecauseOf(because, becauseArgs)
- .FailWith(expectationPrefix + "but " + count.ToString(CultureInfo.InvariantCulture) + " such items were found.", predicate);
- break;
- default:
- break;
+ Execute.Assertion
+ .BecauseOf(because, becauseArgs)
+ .FailWith(expectationPrefix + "but no such item was found.", predicate);
+ }
+ else if (count > 1)
+ {
+ Execute.Assertion
+ .BecauseOf(because, becauseArgs)
+ .FailWith(
+ expectationPrefix + "but " + count.ToString(CultureInfo.InvariantCulture) + " such items were found.",
+ predicate);
+ }
+ else
+ {
+ // Can never happen
}
}
@@ -1190,7 +1223,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, string because = "",
+ params object[] becauseArgs)
{
Guard.ThrowIfArgumentIsNull(expectation, nameof(expectation), "Cannot compare collection with .");
@@ -1247,7 +1281,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, string because = "",
+ params object[] becauseArgs)
{
AssertSubjectEquality(expectation, equalityComparison, because, becauseArgs);
@@ -1321,7 +1356,8 @@ public AndConstraint HaveCount(int expected, string because = "", p
public AndConstraint HaveCount(Expression> countPredicate, string because = "",
params object[] becauseArgs)
{
- Guard.ThrowIfArgumentIsNull(countPredicate, nameof(countPredicate), "Cannot compare collection count against a predicate.");
+ Guard.ThrowIfArgumentIsNull(countPredicate, nameof(countPredicate),
+ "Cannot compare collection count against a predicate.");
bool success = Execute.Assertion
.BecauseOf(because, becauseArgs)
@@ -1357,7 +1393,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, string because = "",
+ params object[] becauseArgs)
{
Execute.Assertion
.BecauseOf(because, becauseArgs)
@@ -1376,7 +1413,8 @@ public AndConstraint HaveCountGreaterThanOrEqualTo(int expected, st
}
[EditorBrowsable(EditorBrowsableState.Never)]
- public AndConstraint HaveCountGreaterOrEqualTo(int expected, string because = "", params object[] becauseArgs) => HaveCountGreaterThanOrEqualTo(expected, because, becauseArgs);
+ 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.
@@ -1437,7 +1475,8 @@ public AndConstraint HaveCountLessThanOrEqualTo(int expected, strin
}
[EditorBrowsable(EditorBrowsableState.Never)]
- public AndConstraint HaveCountLessOrEqualTo(int expected, string because = "", params object[] becauseArgs) => HaveCountLessThanOrEqualTo(expected, because, becauseArgs);
+ 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.
@@ -1525,7 +1564,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, string because = "",
+ params object[] becauseArgs)
{
Execute.Assertion
.BecauseOf(because, becauseArgs)
@@ -1561,7 +1601,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, string because = "",
+ params object[] becauseArgs)
{
Execute.Assertion
.BecauseOf(because, becauseArgs)
@@ -1633,7 +1674,8 @@ public AndConstraint HaveSameCount(IEnumerable IntersectWith(IEnumerable otherCollection, string because = "",
params object[] becauseArgs)
{
- Guard.ThrowIfArgumentIsNull(otherCollection, nameof(otherCollection), "Cannot verify intersection against a collection.");
+ Guard.ThrowIfArgumentIsNull(otherCollection, nameof(otherCollection),
+ "Cannot verify intersection against a collection.");
bool success = Execute.Assertion
.BecauseOf(because, becauseArgs)
@@ -1711,7 +1753,8 @@ public AndConstraint NotBeEquivalentTo(IEnumerable NotBeInAscendingOrder(
public AndConstraint NotBeInAscendingOrder(
IComparer comparer, string because = "", params object[] becauseArgs)
{
- Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer.");
+ Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer),
+ "Cannot assert collection ordering without specifying a comparer.");
+
return NotBeInOrder(comparer, SortOrder.Ascending, because, becauseArgs);
}
@@ -1838,9 +1883,12 @@ public AndConstraint NotBeInAscendingOrder(
///
/// is .
public AndConstraint NotBeInAscendingOrder(
- Expression> propertyExpression, IComparer comparer, string because = "", params object[] becauseArgs)
+ Expression> propertyExpression, IComparer comparer, string because = "",
+ params object[] becauseArgs)
{
- Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer.");
+ Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer),
+ "Cannot assert collection ordering without specifying a comparer.");
+
return NotBeOrderedBy(propertyExpression, comparer, SortOrder.Ascending, because, becauseArgs);
}
@@ -1879,7 +1927,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, string because = "",
+ params object[] becauseArgs)
{
return NotBeInOrder(Comparer.Create((x, y) => comparison(x, y)), SortOrder.Ascending, because, becauseArgs);
}
@@ -1928,7 +1977,9 @@ public AndConstraint NotBeInDescendingOrder(
public AndConstraint NotBeInDescendingOrder(
IComparer comparer, string because = "", params object[] becauseArgs)
{
- Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer.");
+ Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer),
+ "Cannot assert collection ordering without specifying a comparer.");
+
return NotBeInOrder(comparer, SortOrder.Descending, because, becauseArgs);
}
@@ -1954,9 +2005,12 @@ public AndConstraint NotBeInDescendingOrder(
///
/// is .
public AndConstraint NotBeInDescendingOrder(
- Expression> propertyExpression, IComparer comparer, string because = "", params object[] becauseArgs)
+ Expression> propertyExpression, IComparer comparer, string because = "",
+ params object[] becauseArgs)
{
- Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer), "Cannot assert collection ordering without specifying a comparer.");
+ Guard.ThrowIfArgumentIsNull(comparer, nameof(comparer),
+ "Cannot assert collection ordering without specifying a comparer.");
+
return NotBeOrderedBy(propertyExpression, comparer, SortOrder.Descending, because, becauseArgs);
}
@@ -1995,7 +2049,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, string because = "",
+ params object[] becauseArgs)
{
return NotBeInOrder(Comparer.Create((x, y) => comparison(x, y)), SortOrder.Descending, because, becauseArgs);
}
@@ -2041,7 +2096,8 @@ public AndConstraint NotBeSubsetOf(IEnumerable unexpectedSuperse
{
Execute.Assertion
.BecauseOf(because, becauseArgs)
- .FailWith("Did not expect {context:collection} {0} to be a subset of {1}{reason}, but they both reference the same object.",
+ .FailWith(
+ "Did not expect {context:collection} {0} to be a subset of {1}{reason}, but they both reference the same object.",
Subject,
unexpectedSuperset);
}
@@ -2052,7 +2108,8 @@ public AndConstraint NotBeSubsetOf(IEnumerable unexpectedSuperse
{
Execute.Assertion
.BecauseOf(because, becauseArgs)
- .FailWith("Did not expect {context:collection} {0} to be a subset of {1}{reason}.", actualItems, unexpectedSuperset);
+ .FailWith("Did not expect {context:collection} {0} to be a subset of {1}{reason}.", actualItems,
+ unexpectedSuperset);
}
}
@@ -2082,6 +2139,7 @@ public AndWhichConstraint NotContain(T unexpected, string becaus
if (success)
{
ICollection