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/.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 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/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 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..e66f168f8c 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -1,7 +1,7 @@  Exe - net8.0 + net9.0 CS0649;CS0169 ..\ @@ -10,13 +10,13 @@ 1 - - + + - + diff --git a/Directory.Build.props b/Directory.Build.props index 2f23cead51..106b8b8cbb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 12.0 + 13.0 false true @@ -13,12 +13,12 @@ true - 8.0 + 9.0 All true - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -30,11 +30,11 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive 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/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/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 908a8bfad4..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) @@ -3050,8 +3060,6 @@ public AndConstraint AllSatisfy(Action expected, [StringSyntax(" chain => chain .FailWithPreFormatted(failureMessage)); } - - return new AndConstraint((TAssertions)this); } return new AndConstraint((TAssertions)this); @@ -3128,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) @@ -3213,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(); @@ -3480,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) @@ -3600,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..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(x => x)); + 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) { @@ -45,12 +49,12 @@ 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; int implementationFlagsMatchingImplementationOptions = - (int)implementationFlags & ImplementationOptionsMask.Value; + (int)implementationFlags & ImplementationOptionsMask; MethodImplOptions implementationOptions = (MethodImplOptions)implementationFlagsMatchingImplementationOptions; 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/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/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/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/EquivalencyValidationContext.cs b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs index f596364fa8..d6cee4a0cd 100644 --- a/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs +++ b/Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs @@ -71,15 +71,31 @@ 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); } 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/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/Execution/ObjectReference.cs b/Src/FluentAssertions/Equivalency/Execution/ObjectReference.cs index c0b3fb9fdb..4d68cb292d 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; } /// @@ -49,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); } /// @@ -69,5 +79,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/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/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/Selection/ExcludeMembersByNameSelectionRule.cs b/Src/FluentAssertions/Equivalency/Selection/ExcludeMembersByNameSelectionRule.cs new file mode 100644 index 0000000000..271e5c15d6 --- /dev/null +++ b/Src/FluentAssertions/Equivalency/Selection/ExcludeMembersByNameSelectionRule.cs @@ -0,0 +1,39 @@ +using System; +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, StringComparer.Ordinal)).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..1e2bb6b046 100644 --- a/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs +++ b/Src/FluentAssertions/Equivalency/SelfReferenceEquivalencyOptions.cs @@ -12,15 +12,16 @@ using FluentAssertions.Equivalency.Selection; using FluentAssertions.Equivalency.Steps; using FluentAssertions.Equivalency.Tracing; +using FluentAssertions.Equivalency.Typing; 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. /// -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(); /// @@ -275,6 +286,21 @@ public TSelf IncludingProperties() { includedProperties = MemberVisibility.Public | MemberVisibility.ExplicitlyImplemented | MemberVisibility.DefaultInterfaceProperties; + + 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; } @@ -285,6 +311,7 @@ public TSelf IncludingInternalProperties() { includedProperties = MemberVisibility.Public | MemberVisibility.Internal | MemberVisibility.ExplicitlyImplemented | MemberVisibility.DefaultInterfaceProperties; + return (TSelf)this; } @@ -300,6 +327,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. /// @@ -584,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. /// @@ -688,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; } @@ -779,7 +838,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(); @@ -826,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()); @@ -849,6 +912,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/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/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/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/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/AssertionChain.cs b/Src/FluentAssertions/Execution/AssertionChain.cs index 5422c05c1e..7e9a3c77aa 100644 --- a/Src/FluentAssertions/Execution/AssertionChain.cs +++ b/Src/FluentAssertions/Execution/AssertionChain.cs @@ -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); } @@ -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 1a3e135c05..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) { @@ -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..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) @@ -54,20 +57,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..010150d46a 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 , the assembly specified by the property will + /// be dynamically loaded if it is not already loaded in the application domain. + /// When set to , 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/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/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/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/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 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/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/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); } } 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/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/Primitives/StringAssertions.cs b/Src/FluentAssertions/Primitives/StringAssertions.cs index d114002e9b..6c4a8a9833 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); + ICollection strings = values?.ConvertOrCastToCollection(); + 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/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/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/Specialized/AsyncFunctionAssertions.cs b/Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs index 6f5d0cc81a..a775860198 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. @@ -277,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/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/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/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/Src/FluentAssertions/Types/AssemblyAssertions.cs b/Src/FluentAssertions/Types/AssemblyAssertions.cs index 5ceac78772..f0ba014e31 100644 --- a/Src/FluentAssertions/Types/AssemblyAssertions.cs +++ b/Src/FluentAssertions/Types/AssemblyAssertions.cs @@ -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); } 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 ad676f998f..79290986d4 100644 --- a/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs +++ b/Src/FluentAssertions/Xml/Equivalency/XmlReaderValidator.cs @@ -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); } + } - if (!shouldBeEquivalent && failure is null) + public void AssertThatIsNotEquivalent() + { + Failure failure = Validate(); + + 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) { @@ -82,6 +85,7 @@ private Failure Validate() #pragma warning restore IDE0010 { case XmlNodeType.Element: + { failure = ValidateStartElement(); if (failure is not null) @@ -111,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) @@ -164,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/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..5570c5f2ef 100644 --- a/Src/FluentAssertions/Xml/XElementAssertions.cs +++ b/Src/FluentAssertions/Xml/XElementAssertions.cs @@ -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/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 1a3356ee65..f903b7ec0a 100644 --- a/Src/FluentAssertions/Xml/XmlNodeAssertions.cs +++ b/Src/FluentAssertions/Xml/XmlNodeAssertions.cs @@ -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..24826087b3 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 @@ -50,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' @@ -60,6 +67,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 @@ -87,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 @@ -94,6 +108,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 +212,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 diff --git a/Tests/Approval.Tests/Approval.Tests.csproj b/Tests/Approval.Tests/Approval.Tests.csproj index 7fc4bea4f2..dc71966bfb 100644 --- a/Tests/Approval.Tests/Approval.Tests.csproj +++ b/Tests/Approval.Tests/Approval.Tests.csproj @@ -7,13 +7,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + diff --git a/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt b/Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt index a27b801a94..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) { } @@ -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() { } @@ -945,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() { } @@ -952,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) { } @@ -1043,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() { } @@ -1684,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) { } @@ -1735,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) { } @@ -2027,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) { } @@ -2052,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) { } @@ -2090,10 +2099,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 { } } @@ -2115,6 +2126,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) @@ -2567,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 { @@ -2588,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 399891910b..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) { } @@ -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() { } @@ -958,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() { } @@ -965,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) { } @@ -1056,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() { } @@ -1703,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) { } @@ -1742,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) { } @@ -1793,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) { } @@ -2111,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) { } @@ -2136,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) { } @@ -2161,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) { } @@ -2211,10 +2220,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 { } } @@ -2236,6 +2247,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) @@ -2697,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 { @@ -2718,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 acbf851e37..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) { } @@ -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() { } @@ -937,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() { } @@ -944,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) { } @@ -1035,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() { } @@ -1628,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) { } @@ -1679,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) { } @@ -1971,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) { } @@ -1996,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) { } @@ -2034,10 +2043,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 { } } @@ -2059,6 +2070,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) @@ -2511,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 { @@ -2532,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 44fb44ddd2..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) { } @@ -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() { } @@ -945,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() { } @@ -952,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) { } @@ -1043,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() { } @@ -1684,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) { } @@ -1735,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) { } @@ -2027,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) { } @@ -2052,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) { } @@ -2090,10 +2099,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 { } } @@ -2115,6 +2126,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) @@ -2569,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 { @@ -2590,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 { 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 @@ - + 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/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/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/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.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.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/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.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/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/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/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/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/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 = () => 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 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; 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/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 - + 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 @@ - + 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 @@ - - + + 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 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 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 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 f0756e45f2..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. @@ -123,6 +158,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..5f1565fb92 100644 --- a/docs/_pages/releases.md +++ b/docs/_pages/releases.md @@ -7,18 +7,35 @@ 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) + +## Fixes + +* Ensured `WithTracing` is safe when used with `BeEquivalentTo` globally - [#3067](https://github.com/fluentassertions/fluentassertions/pull/3067) + +## 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) + ## 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 ## 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 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" } } diff --git a/package-lock.json b/package-lock.json index bc528e8a7a..a4f6676642 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,18 +7,17 @@ "": { "version": "1.0.1", "dependencies": { - "cspell": "^9.0.1" + "cspell": "^9.1.3" } }, "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==", - "license": "MIT", + "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", @@ -31,33 +30,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.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.4", - "@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.9", "@cspell/dict-php": "^4.0.14", "@cspell/dict-powershell": "^5.0.14", "@cspell/dict-public-licenses": "^2.0.13", @@ -67,12 +66,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.8", + "@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-typescript": "^3.2.1", + "@cspell/dict-terraform": "^1.1.2", + "@cspell/dict-typescript": "^3.2.2", "@cspell/dict-vue": "^3.0.4" }, "engines": { @@ -80,31 +79,28 @@ } }, "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==", - "license": "MIT", + "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.0.1" + "@cspell/cspell-types": "9.1.3" }, "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==", - "license": "MIT", + "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.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", + "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" }, @@ -113,19 +109,17 @@ } }, "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==", - "license": "MIT", + "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.0.1", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-9.0.1.tgz", - "integrity": "sha512-8FRmvyV1AYEepJB3J7jji1ZYG9yOK0eYr4WuUVPfUJa6N3HyeZjWKhxbVvqedmEI74f5Ls3cQKHY1T2Yvqk/ag==", - "license": "MIT", + "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" } @@ -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" + "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", "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,260 +150,218 @@ "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.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.8.tgz", - "integrity": "sha512-OkNUVuU9Q+Sf827/61YPkk6ya6dSsllzeYniBFqNW9TkoqQXT3vggkgmtCE1aEhSvVctMwxpPYoC8pZgn1TeSA==", - "license": "MIT" + "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.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" + "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.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" + "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", "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.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.4.tgz", - "integrity": "sha512-C44M+m56rYn6QCsLbiKiedyPTMZxlDdEYAsPwwlL5bhMDDzXZ3Ic8OCQIhMbiunhCOJJT+er4URmOmM+sllnjg==", - "license": "MIT" + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.0.6.tgz", + "integrity": "sha512-nazfOqyxlBOQGgcur9ssEOEQCEZkH8vXfQe8SDEx8sCN/g0SFm8ktabgLVmBOXjy3RzjVNLlM2nBfRQ7e6+5hQ==" }, "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==", - "license": "MIT" + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.22.tgz", + "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.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.10.tgz", - "integrity": "sha512-313haTrX9prep1yWO7N6Xw4D6tvUJ0Xsx+YhCP+5YrrcIKoEw5Rtlg8R4PPzLqe6zibw6aJ+Eqq+y76Vx5BZkw==", - "license": "MIT" + "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==" }, "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.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.10.tgz", - "integrity": "sha512-vtVa6L/84F9sTjclTYDkWJF/Vx2c5xzxBKkQp+CEFlxOF2SYgm+RSoEvAvg5vj4N5kuqR4350ZlY3zl2eA3MXw==", - "license": "MIT", + "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==", "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": { "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.3", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.3.tgz", - "integrity": "sha512-EdGkCpAq66Mhi9Qldgsr+NvPVL4TdtmdlqDe4VBp0P3n6J0B7b0jT1MlVDIiLR+F1eqBfL0qjfHf0ey1CafeNw==", - "license": "MIT" + "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", "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.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.0.8.tgz", - "integrity": "sha512-VsJesitvaHZpMgNwHHms3yDsZz7LNToC2HuSAnyt1znn37ribiJF1ty0jWhVQO6fv7K4PM1KsKTJIwqBwc446g==", - "license": "MIT" + "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", "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" + "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.1", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.1.tgz", - "integrity": "sha512-jdnKg4rBl75GUBTsUD6nTJl7FGvaIt5wWcWP7TZSC3rV1LfkwvbUiY3PiGpfJlAIdnLYSeFWIpYU9gyVgz206w==", - "license": "MIT" + "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==" }, "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.0.1", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-9.0.1.tgz", - "integrity": "sha512-BoWzHwkufo90ubMZUN8Jy4HQYYWFW7psVCdG/4RUgfvVnazkPfLxWBbsPQsLrlIP0utaqei7D9FU0K7r7mpl4A==", - "license": "MIT", + "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.0.1", + "@cspell/url": "9.1.3", "import-meta-resolve": "^4.1.0" }, "engines": { @@ -504,28 +439,25 @@ } }, "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==", - "license": "MIT", + "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.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", + "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.0.1", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.0.1.tgz", - "integrity": "sha512-8xaLrsQ742dmwXwS6tjreps3NpSQe6WEZFPQQT2DprVJXGZnfQR8ob0c+kPhD0hu9A6PwShJsRsfh3DQGKCqAw==", - "license": "MIT", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-9.1.3.tgz", + "integrity": "sha512-LQQKY0O4QYUNKyDod8VfEBvqeJNGHJlx1v0gDq00eMvaClnkIz+y2ObGdtDlF7ZbG7TgI6PQ3ahJdlqfRPe3ZQ==", "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" @@ -588,19 +517,18 @@ } }, "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": { "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,32 +543,31 @@ "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.0.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-9.0.1.tgz", - "integrity": "sha512-AJqsX+3eSTz9GmIuyEZUzCCTbvCPw6+Nv7UYa4PCn7vNV3XEb5LHTp5i9y2i65fNaeNEcQXLrLYoY/JcBFmUSQ==", - "license": "MIT", + "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.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.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": "^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-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.1", - "tinyglobby": "^0.2.13" + "semver": "^7.7.2", + "tinyglobby": "^0.2.14" }, "bin": { "cspell": "bin.mjs", @@ -654,28 +581,27 @@ } }, "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==", - "license": "MIT", + "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.0.1", + "@cspell/cspell-types": "9.1.3", "comment-json": "^4.2.5", - "yaml": "^2.7.1" + "smol-toml": "^1.4.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==", - "license": "MIT", + "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.0.1", - "@cspell/cspell-types": "9.0.1", - "cspell-trie-lib": "9.0.1", + "@cspell/cspell-pipe": "9.1.3", + "@cspell/cspell-types": "9.1.3", + "cspell-trie-lib": "9.1.3", "fast-equals": "^5.2.2" }, "engines": { @@ -683,14 +609,13 @@ } }, "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==", - "license": "MIT", + "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.0.1", - "cspell-glob": "9.0.1", - "cspell-io": "9.0.1" + "@cspell/url": "9.1.3", + "cspell-glob": "9.1.3", + "cspell-io": "9.1.3" }, "bin": { "cspell-gitignore": "bin.mjs" @@ -700,12 +625,11 @@ } }, "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==", - "license": "MIT", + "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.0.1", + "@cspell/url": "9.1.3", "picomatch": "^4.0.2" }, "engines": { @@ -713,13 +637,12 @@ } }, "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==", - "license": "MIT", + "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.0.1", - "@cspell/cspell-types": "9.0.1" + "@cspell/cspell-pipe": "9.1.3", + "@cspell/cspell-types": "9.1.3" }, "bin": { "cspell-grammar": "bin.mjs" @@ -729,40 +652,38 @@ } }, "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==", - "license": "MIT", + "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.0.1", - "@cspell/url": "9.0.1" + "@cspell/cspell-service-bus": "9.1.3", + "@cspell/url": "9.1.3" }, "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==", - "license": "MIT", + "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.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.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.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.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", @@ -777,13 +698,12 @@ } }, "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==", - "license": "MIT", + "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.0.1", - "@cspell/cspell-types": "9.0.1", + "@cspell/cspell-pipe": "9.1.3", + "@cspell/cspell-types": "9.1.3", "gensequence": "^7.0.0" }, "engines": { @@ -794,7 +714,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" }, @@ -806,7 +725,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" @@ -819,7 +737,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" } @@ -831,9 +748,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" @@ -876,7 +793,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" } @@ -885,7 +801,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" }, @@ -900,7 +815,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" } @@ -909,7 +823,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" @@ -925,7 +838,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" }, @@ -937,7 +849,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" } @@ -946,7 +857,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" @@ -956,7 +866,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" } @@ -978,7 +887,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" }, @@ -1002,7 +910,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" } @@ -1011,15 +918,14 @@ "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/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" @@ -1028,10 +934,21 @@ "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.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", @@ -1047,20 +964,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" }, @@ -1069,15 +983,14 @@ } }, "node_modules/yaml": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz", - "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==", - "license": "ISC", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", + "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", "bin": { "yaml": "bin.mjs" }, "engines": { - "node": ">= 14" + "node": ">= 14.6" } } } diff --git a/package.json b/package.json index 14ff472b1c..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.0.1" + "cspell": "^9.1.3" } }