diff --git a/src/.editorconfig b/src/.editorconfig new file mode 100644 index 00000000..e05545ed --- /dev/null +++ b/src/.editorconfig @@ -0,0 +1,1662 @@ +# (c) Copyright BBT Software AG +# Version 18.08.2025 13:30 + +# This is the top most settings file containing only the general rules. +# Apply project specific rules in the appropriate subfolder (eg. `src`, `test`, `doc` etc.) +root = true + +# All files +[*] +guidelines = 180 +max_line_length = 180 + +# editorconfig +[*.editorconfig] +charset = utf-8 +end_of_line = crlf +insert_final_newline = true +trim_trailing_whitespace = true + +# Git files +[*.{gitignore, gitattributes}] +charset = utf-8 +insert_final_newline = true + +# bicep files +[*.bicep] +charset = utf-8 +end_of_line = crlf +insert_final_newline = true +indent_size = 2 +indent_style = space + +# Xml project files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] +charset = utf-8 +indent_size = 2 + +# Xml config files +[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct,xml,xsc,xsd,xslt,xss,xsx,setings,stylecop}] +charset = utf-8 +end_of_line = crlf +indent_size = 2 +indent_style = space +trim_trailing_whitespace = true + +# Visual Studio Solution files +[*.{sln, slnx}] +charset = utf-8-bom +end_of_line = crlf +indent_size = 4 +indent_style = tab + +# JSON files +[*.json] +charset = utf-8-bom +end_of_line = crlf +indent_size = 2 +indent_style = space +trim_trailing_whitespace = true + +# Cake scripts +[*.cake] +charset = utf-8-bom +end_of_line = crlf +indent_size = 4 +indent_style = space + +# Powershell files +[*.{ps1,psm1,psd1}] +charset = utf-8-bom +end_of_line = crlf +indent_size = 4 +indent_style = space + +# Shell scripts +[*.sh] +charset = utf-8-bom +end_of_line = lf +indent_size = 2 +indent_style = space + +# Commandline scritps and batch files +[*.{cmd,bat}] +charset = utf-8-bom +end_of_line = crlf +indent_size = 4 +indent_style = space + +# T-SQL scripts +[*.sql] +charset = utf-8 +end_of_line = crlf +indent_size = 4 +indent_style = space + +# YAML pipeline files +[*.yaml] +charset = utf-8-bom +end_of_line = crlf +indent_size = 2 +indent_style = space + +# Markdown files +[*.md] +charset = utf-8 +end_of_line = crlf +indent_size = 4 +indent_style = space +insert_final_newline = true + +# ASPX und HTML files +[*.{aspx,htm,html}] +charset = utf-8-bom +end_of_line = crlf +indent_size = 4 +indent_style = space + +# ASMX/ASAX files +[*.{aspx,asax,asmx}] +charset = utf-8-bom +end_of_line = crlf +insert_final_newline = true + +# CSS files +[*.{css,scss,less}] +charset = utf-8 +end_of_line = crlf +indent_size = 2 +indent_style = space + + +# -------------------------------------------------------------------------- +# INFO: The definition for {*.cs,vb} code files must be placed at the end +# in order for the following styling rules to take effect. +# -------------------------------------------------------------------------- + +# Code files +[*.{cs,vb}] +charset = utf-8-bom +end_of_line = crlf +insert_final_newline = true +indent_size = 4 +indent_style = space +trim_trailing_whitespace = true +file_header_template = Copyright (c) BBT Software AG. All Rights Reserved. + + +# +# STYLING RULES +# ##################################################################################################################### + +# XML comment analysis disabled +dotnet_diagnostic.SA0001.severity = none + +# Invalid settings file (not set / default) +# dotnet_diagnostic.SA0002.severity = + +# Keywords should be spaced correctly +dotnet_diagnostic.SA1000.severity = warning + +# Commas should be spaced correctly +dotnet_diagnostic.SA1001.severity = warning + +# Semicolons should be spaced correctly +dotnet_diagnostic.SA1002.severity = warning + +# Symbols should be spaced correctly +dotnet_diagnostic.SA1003.severity = warning + +# Documentation lines should begin with single space +dotnet_diagnostic.SA1004.severity = warning + +# Single line comments should begin with single space +dotnet_diagnostic.SA1005.severity = suggestion + +# Preprocessor keywords should not be preceded by space (not set / default) +# dotnet_diagnostic.SA1006.severity = + +# Operator keyword should be followed by space +dotnet_diagnostic.SA1007.severity = warning + +# Opening parenthesis should be spaced correctly +dotnet_diagnostic.SA1008.severity = warning + +# Closing parenthesis should be spaced correctly +dotnet_diagnostic.SA1009.severity = warning + +# Opening square brackets should be spaced correctly +dotnet_diagnostic.SA1010.severity = warning + +# Closing square brackets should be spaced correctly +dotnet_diagnostic.SA1011.severity = warning + +# Opening braces should be spaced correctly +dotnet_diagnostic.SA1012.severity = warning + +# Closing braces should be spaced correctly +dotnet_diagnostic.SA1013.severity = warning + +# Opening generic brackets should be spaced correctly +dotnet_diagnostic.SA1014.severity = warning + +# Closing generic brackets should be spaced correctly +dotnet_diagnostic.SA1015.severity = warning + +# Opening attribute brackets should be spaced correctly +dotnet_diagnostic.SA1016.severity = warning + +# Closing attribute brackets should be spaced correctly +dotnet_diagnostic.SA1017.severity = warning + +# Nullable type symbols should be spaced correctly +dotnet_diagnostic.SA1018.severity = suggestion + +# Member access symbols should be spaced correctly +dotnet_diagnostic.SA1019.severity = warning + +# Increment decrement symbols should be spaced correctly +dotnet_diagnostic.SA1020.severity = warning + +# Negative signs should be spaced correctly +dotnet_diagnostic.SA1021.severity = warning + +# Positive signs should be spaced correctly +dotnet_diagnostic.SA1022.severity = warning + +# Dereference and access of symbols should be spaced correctly +dotnet_diagnostic.SA1023.severity = warning + +# Colons should be spaced correctly +dotnet_diagnostic.SA1024.severity = warning + +# Code should not contain multiple whitespace in a row +dotnet_diagnostic.SA1025.severity = warning + +# Code should not contain space after new or stackalloc keyword in implicitly typed array allocation +dotnet_diagnostic.SA1026.severity = warning + +# Use tabs correctly +dotnet_diagnostic.SA1027.severity = warning + +# Code should not contain trailing whitespace +dotnet_diagnostic.SA1028.severity = none + +# Do not prefix calls with base unless local implementation exists +dotnet_diagnostic.SA1100.severity = warning + +# Prefix local calls with this +dotnet_diagnostic.SA1101.severity = none + +# Query clause should follow previous clause +dotnet_diagnostic.SA1102.severity = suggestion + +# Query clauses should be on separate lines or all on one line +dotnet_diagnostic.SA1103.severity = suggestion + +# Query clause should begin on new line when previous clause spans multiple lines +dotnet_diagnostic.SA1104.severity = suggestion + +# Query clauses spanning multiple lines should begin on own line +dotnet_diagnostic.SA1105.severity = suggestion + +# Code should not contain empty statements +dotnet_diagnostic.SA1106.severity = warning + +# Code should not contain multiple statements on one line +dotnet_diagnostic.SA1107.severity = warning + +# Block statements should not contain embedded comments +dotnet_diagnostic.SA1108.severity = none + +# Block statements should not contain embedded regions (not set / default) +# dotnet_diagnostic.SA1109.severity = + +# Opening parenthesis or bracket should be on declaration line +dotnet_diagnostic.SA1110.severity = warning + +# Closing parenthesis should be on line of last parameter +dotnet_diagnostic.SA1111.severity = warning + +# Closing parenthesis should be on line of opening parenthesis +dotnet_diagnostic.SA1112.severity = warning + +# Comma should be on the same line as previous parameter +dotnet_diagnostic.SA1113.severity = warning + +# Parameter list should follow declaration +dotnet_diagnostic.SA1114.severity = warning + +# Parameter should follow comma +dotnet_diagnostic.SA1115.severity = warning + +# Split parameters should start on line after declaration +dotnet_diagnostic.SA1116.severity = warning + +# Parameters should be on same line or separate lines +dotnet_diagnostic.SA1117.severity = warning + +# Parameter should not span multiple lines +dotnet_diagnostic.SA1118.severity = none + +# Statement should not use unnecessary parenthesis +dotnet_diagnostic.SA1119.severity = none + +# Comments should contain text +dotnet_diagnostic.SA1120.severity = none + +# Use built-in type alias +dotnet_diagnostic.SA1121.severity = suggestion + +# Use string.Empty for empty strings +dotnet_diagnostic.SA1122.severity = suggestion + +# Do not place regions within elements (not set / default) +# dotnet_diagnostic.SA1123.severity = + +# Do not use regions +dotnet_diagnostic.SA1124.severity = warning + +# Use shorthand for nullable types +dotnet_diagnostic.SA1125.severity = suggestion + +# Prefix calls correctly +dotnet_diagnostic.SA1126.severity = none + +# Generic type constraints should be on their own line +dotnet_diagnostic.SA1127.severity = warning + +# Put constructor initializers on their own line +dotnet_diagnostic.SA1128.severity = warning + +# Do not use default value type constructor +dotnet_diagnostic.SA1129.severity = none + +# Use lambda syntax +dotnet_diagnostic.SA1130.severity = suggestion + +# Use readable conditions +dotnet_diagnostic.SA1131.severity = suggestion + +# Do not combine fields +dotnet_diagnostic.SA1132.severity = warning + +# Do not combine attributes +dotnet_diagnostic.SA1133.severity = warning + +# Attributes should not share line +dotnet_diagnostic.SA1134.severity = warning + +# Using directives should be qualified +dotnet_diagnostic.SA1135.severity = warning + +# Enum values should be on separate lines +dotnet_diagnostic.SA1136.severity = warning + +# Elements should have the same indentation +dotnet_diagnostic.SA1137.severity = warning + +# Use literal suffix notation instead of casting +dotnet_diagnostic.SA1139.severity = suggestion + +# Using directives should be placed correctly +dotnet_diagnostic.SA1200.severity = none + +# Elements should appear in the correct order +dotnet_diagnostic.SA1201.severity = suggestion + +# Elements should be ordered by access +dotnet_diagnostic.SA1202.severity = suggestion + +# Constants should appear before fields +dotnet_diagnostic.SA1203.severity = suggestion + +# Static elements should appear before instance elements +dotnet_diagnostic.SA1204.severity = suggestion + +# Partial elements should declare access +dotnet_diagnostic.SA1205.severity = suggestion + +# Declaration keywords should follow order +dotnet_diagnostic.SA1206.severity = suggestion + +# Protected should come before internal +dotnet_diagnostic.SA1207.severity = suggestion + +# System using directives should be placed before other using directives +dotnet_diagnostic.SA1208.severity = suggestion + +# Using alias directives should be placed after other using directives +dotnet_diagnostic.SA1209.severity = suggestion + +# Using directives should be ordered alphabetically by namespace +dotnet_diagnostic.SA1210.severity = suggestion + +# Using alias directives should be ordered alphabetically by alias name +dotnet_diagnostic.SA1211.severity = suggestion + +# Property accessors should follow order +dotnet_diagnostic.SA1212.severity = suggestion + +# Event accessors should follow order +dotnet_diagnostic.SA1213.severity = suggestion + +# Readonly fields should appear before non-readonly fields +dotnet_diagnostic.SA1214.severity = suggestion + +# Using static directives should be placed at the correct location +dotnet_diagnostic.SA1216.severity = suggestion + +# Using static directives should be ordered alphabetically +dotnet_diagnostic.SA1217.severity = suggestion + +# Element should begin with upper-case letter +dotnet_diagnostic.SA1300.severity = suggestion + +# Element should begin with lower-case letter +dotnet_diagnostic.SA1301.severity = none + +# Interface names should begin with I +dotnet_diagnostic.SA1302.severity = warning + +# Const field names should begin with upper-case letter +dotnet_diagnostic.SA1303.severity = warning + +# Non-private readonly fields should begin with upper-case letter +dotnet_diagnostic.SA1304.severity = warning + +# Field names should not use Hungarian notation +dotnet_diagnostic.SA1305.severity = error + +# Field names should begin with lower-case letter +dotnet_diagnostic.SA1306.severity = warning + +# Accessible fields should begin with upper-case letter +dotnet_diagnostic.SA1307.severity = warning + +# Variable names should not be prefixed +dotnet_diagnostic.SA1308.severity = error + +# Field names should not begin with underscore +dotnet_diagnostic.SA1309.severity = error + +# Field names should not contain underscore +dotnet_diagnostic.SA1310.severity = error + +# Static readonly fields should begin with upper-case letter +dotnet_diagnostic.SA1311.severity = none + +# Variable names should begin with lower-case letter +dotnet_diagnostic.SA1312.severity = warning + +# Parameter names should begin with lower-case letter +dotnet_diagnostic.SA1313.severity = warning + +# Type parameter names should begin with T +dotnet_diagnostic.SA1314.severity = warning + +# Access modifier should be declared +dotnet_diagnostic.SA1400.severity = warning + +# Fields should be private +dotnet_diagnostic.SA1401.severity = warning + +# File may only contain a single type +dotnet_diagnostic.SA1402.severity = suggestion + +# File may only contain a single namespace +dotnet_diagnostic.SA1403.severity = suggestion + +# Code analysis suppression should have justification +dotnet_diagnostic.SA1404.severity = warning + +# Debug.Assert should provide message text +dotnet_diagnostic.SA1405.severity = none + +# Debug.Fail should provide message text +dotnet_diagnostic.SA1406.severity = none + +# Arithmetic expressions should declare precedence +dotnet_diagnostic.SA1407.severity = warning + +# Conditional expressions should declare precedence +dotnet_diagnostic.SA1408.severity = suggestion + +# Remove unnecessary code +dotnet_diagnostic.SA1409.severity = warning + +# Remove delegate parenthesis when possible +dotnet_diagnostic.SA1410.severity = none + +# Attribute constructor should not use unnecessary parenthesis +dotnet_diagnostic.SA1411.severity = suggestion + +# Store files as UTF-8 with byte order mark +dotnet_diagnostic.SA1412.severity = warning + +# Use trailing comma in multi-line initializers +dotnet_diagnostic.SA1413.severity = none + +# Braces for multi-line statements should not share line +dotnet_diagnostic.SA1500.severity = warning + +# Statement should not be on a single line +dotnet_diagnostic.SA1501.severity = suggestion + +# Element should not be on a single line +dotnet_diagnostic.SA1502.severity = suggestion + +# Braces should not be omitted +dotnet_diagnostic.SA1503.severity = warning + +# All accessors should be single-line or multi-line +dotnet_diagnostic.SA1504.severity = suggestion + +# Opening braces should not be followed by blank line +dotnet_diagnostic.SA1505.severity = warning + +# Element documentation headers should not be followed by blank line +dotnet_diagnostic.SA1506.severity = warning + +# Code should not contain multiple blank lines in a row +dotnet_diagnostic.SA1507.severity = suggestion + +# Closing braces should not be preceded by blank line +dotnet_diagnostic.SA1508.severity = warning + +# Opening braces should not be preceded by blank line +dotnet_diagnostic.SA1509.severity = warning + +# Chained statement blocks should not be preceded by blank line +dotnet_diagnostic.SA1510.severity = warning + +# While-do footer should not be preceded by blank line +dotnet_diagnostic.SA1511.severity = warning + +# Single-line comments should not be followed by blank line +dotnet_diagnostic.SA1512.severity = none + +# Closing brace should be followed by blank line +dotnet_diagnostic.SA1513.severity = warning + +# Element documentation header should be preceded by blank line +dotnet_diagnostic.SA1514.severity = warning + +# Single-line comment should be preceded by blank line +dotnet_diagnostic.SA1515.severity = none + +# Elements should be separated by blank line +dotnet_diagnostic.SA1516.severity = warning + +# Code should not contain blank lines at start of file +dotnet_diagnostic.SA1517.severity = warning + +# Use line endings correctly at end of file +dotnet_diagnostic.SA1518.severity = suggestion + +# Braces should not be omitted from multi-line child statement +dotnet_diagnostic.SA1519.severity = warning + +# Use braces consistently +dotnet_diagnostic.SA1520.severity = warning + +# Elements should be documented +dotnet_diagnostic.SA1600.severity = none + +# Partial elements should be documented +dotnet_diagnostic.SA1601.severity = none + +# Enumeration items should be documented +dotnet_diagnostic.SA1602.severity = none + +# Documentation should contain valid XML +dotnet_diagnostic.SA1603.severity = warning + +# Element documentation should have summary +dotnet_diagnostic.SA1604.severity = none + +# Partial element documentation should have summary +dotnet_diagnostic.SA1605.severity = none + +# Element documentation should have summary text +dotnet_diagnostic.SA1606.severity = none + +# Partial element documentation should have summary text +dotnet_diagnostic.SA1607.severity = none + +# Element documentation should not have default summary +dotnet_diagnostic.SA1608.severity = none + +# Property documentation should have value +dotnet_diagnostic.SA1609.severity = none + +# Property documentation should have value text +dotnet_diagnostic.SA1610.severity = none + +# Element parameters should be documented +dotnet_diagnostic.SA1611.severity = none + +# Element parameter documentation should match element parameters +dotnet_diagnostic.SA1612.severity = warning + +# Element parameter documentation should declare parameter name +dotnet_diagnostic.SA1613.severity = suggestion + +# Element parameter documentation should have text +dotnet_diagnostic.SA1614.severity = warning + +# Element return value should be documented +dotnet_diagnostic.SA1615.severity = none + +# Element return value documentation should have text +dotnet_diagnostic.SA1616.severity = warning + +# Void return value should not be documented +dotnet_diagnostic.SA1617.severity = warning + +# Generic type parameters should be documented +dotnet_diagnostic.SA1618.severity = none + +# Generic type parameters should be documented partial class +dotnet_diagnostic.SA1619.severity = none + +# Generic type parameter documentation should match type parameters +dotnet_diagnostic.SA1620.severity = warning + +# Generic type parameter documentation should declare parameter name +dotnet_diagnostic.SA1621.severity = warning + +# Generic type parameter documentation should have text +dotnet_diagnostic.SA1622.severity = warning + +# Property summary documentation should match accessors +dotnet_diagnostic.SA1623.severity = none + +# Property summary documentation should omit accessor with restricted access +dotnet_diagnostic.SA1624.severity = none + +# Element documentation should not be copied and pasted +dotnet_diagnostic.SA1625.severity = none + +# Single-line comments should not use documentation style slashes +dotnet_diagnostic.SA1626.severity = none + +# Documentation text should not be empty +dotnet_diagnostic.SA1627.severity = warning + +# Documentation text should begin with a capital letter +dotnet_diagnostic.SA1628.severity = none + +# Documentation text should end with a period +dotnet_diagnostic.SA1629.severity = none + +# Documentation text should contain whitespace +dotnet_diagnostic.SA1630.severity = none + +# Documentation should meet character percentage +dotnet_diagnostic.SA1631.severity = none + +# Documentation text should meet minimum character length +dotnet_diagnostic.SA1632.severity = none + +# File should have header +dotnet_diagnostic.SA1633.severity = none + +# File header should show copyright +dotnet_diagnostic.SA1634.severity = warning + +# File header should have copyright text +dotnet_diagnostic.SA1635.severity = none + +# File header copyright text should match +dotnet_diagnostic.SA1636.severity = suggestion + +# File header should contain file name +dotnet_diagnostic.SA1637.severity = none + +# File header file name documentation should match file name +dotnet_diagnostic.SA1638.severity = warning + +# File header should have summary +dotnet_diagnostic.SA1639.severity = none + +# File header should have valid company text +dotnet_diagnostic.SA1640.severity = warning + +# File header company name text should match +dotnet_diagnostic.SA1641.severity = suggestion + +# Constructor summary documentation should begin with standard text +dotnet_diagnostic.SA1642.severity = none + +# Destructor summary documentation should begin with standard text +dotnet_diagnostic.SA1643.severity = none + +# Documentation headers should not contain blank lines +dotnet_diagnostic.SA1644.severity = none + +# Included documentation file does not exist +dotnet_diagnostic.SA1645.severity = suggestion + +# Included documentation XPath does not exist +dotnet_diagnostic.SA1646.severity = suggestion + +# Include node does not contain valid file and path +dotnet_diagnostic.SA1647.severity = suggestion + +# Inheritdoc should be used with inheriting class +dotnet_diagnostic.SA1648.severity = warning + +# File name should match first type name +dotnet_diagnostic.SA1649.severity = warning + +# Element documentation should be spelled correctly +dotnet_diagnostic.SA1650.severity = none + +# Do not use placeholder elements (not set / default) +# dotnet_diagnostic.SA1651.severity = + +# Do not prefix local calls with 'this.' +dotnet_diagnostic.SX1101.severity = none + +# Field names should begin with underscore +dotnet_diagnostic.SX1309.severity = none + +# Static field names should begin with underscore +dotnet_diagnostic.SX1309S.severity = none + + +# +# CODE ANALYSIS RULES +# ##################################################################################################################### + +# +# Design Rules +# + +# Do not declare static members on generic types +dotnet_diagnostic.CA1000.severity = none + +# Types that own disposable fields should be disposable +dotnet_diagnostic.CA1001.severity = warning + +# Do not expose generic lists +dotnet_diagnostic.CA1002.severity = none + +# Use generic event handler instances +dotnet_diagnostic.CA1003.severity = warning + +# Avoid excessive parameters on generic types +dotnet_diagnostic.CA1005.severity = none + +# Enums should have zero value +dotnet_diagnostic.CA1008.severity = none + +# Collections should implement generic interface +dotnet_diagnostic.CA1010.severity = none + +# Abstract types should not have public constructors +dotnet_diagnostic.CA1012.severity = warning + +# Mark assemblies with CLSCompliantAttribute +dotnet_diagnostic.CA1014.severity = none + +# Mark assemblies with AssemblyVersionAttribute +dotnet_diagnostic.CA1016.severity = warning + +# Mark assemblies with ComVisibleAttribute +dotnet_diagnostic.CA1017.severity = warning + +# Mark attributes with AttributeUsageAttribute +dotnet_diagnostic.CA1018.severity = warning + +# Define accessors for attribute arguments +dotnet_diagnostic.CA1019.severity = none + +# Avoid out parameters +dotnet_diagnostic.CA1021.severity = suggestion + +# Use properties where appropriate +dotnet_diagnostic.CA1024.severity = none + +# Mark enums with FlagsAttribute +dotnet_diagnostic.CA1027.severity = suggestion + +# Enum storage should be Int32 +dotnet_diagnostic.CA1028.severity = none + +# Use events where appropriate +dotnet_diagnostic.CA1030.severity = none + +# Do not catch general exception types +dotnet_diagnostic.CA1031.severity = none + +# Implement standard exception constructors +dotnet_diagnostic.CA1032.severity = none + +# Interface methods should be callable by child types +dotnet_diagnostic.CA1033.severity = none + +# Nested types should not be visible +dotnet_diagnostic.CA1034.severity = none + +# Override methods on comparable types +dotnet_diagnostic.CA1036.severity = none + +# Avoid empty interfaces +dotnet_diagnostic.CA1040.severity = none + +# Provide ObsoleteAttribute message +dotnet_diagnostic.CA1041.severity = warning + +# Use integral or string argument for indexers +dotnet_diagnostic.CA1043.severity = suggestion + +# Properties should not be write only +dotnet_diagnostic.CA1044.severity = none + +# Do not pass types by reference +dotnet_diagnostic.CA1045.severity = suggestion + +# Do not overload operator equals on reference types +dotnet_diagnostic.CA1046.severity = none + +# Do not declare protected members in sealed types +dotnet_diagnostic.CA1047.severity = warning + +# Declare types in namespaces +dotnet_diagnostic.CA1050.severity = warning + +# Do not declare visible instance fields +dotnet_diagnostic.CA1051.severity = suggestion + +# Static holder types should be sealed +dotnet_diagnostic.CA1052.severity = suggestion + +# Static holder types should not have constructors +dotnet_diagnostic.CA1053.severity = warning + +# URI parameters should not be strings +dotnet_diagnostic.CA1054.severity = none + +# URI return values should not be strings +dotnet_diagnostic.CA1055.severity = none + +# URI properties should not be strings +dotnet_diagnostic.CA1056.severity = none + +# Types should not extend certain base types +dotnet_diagnostic.CA1058.severity = none + +# Move P/Invokes to NativeMethods class +dotnet_diagnostic.CA1060.severity = error + +# Do not hide base class methods +dotnet_diagnostic.CA1061.severity = warning + +# Validate arguments of public methods +dotnet_diagnostic.CA1062.severity = none + +# Implement IDisposable correctly +dotnet_diagnostic.CA1063.severity = suggestion + +# Exceptions should be public +dotnet_diagnostic.CA1064.severity = suggestion + +# Do not raise exceptions in unexpected locations +dotnet_diagnostic.CA1065.severity = none + +# Implement IEquatable when overriding Equals +dotnet_diagnostic.CA1066.severity = none + +# Override Equals when implementing IEquatable +dotnet_diagnostic.CA1067.severity = suggestion + +# CancellationToken parameters must come last +dotnet_diagnostic.CA1068.severity = suggestion + +# Enums should not have duplicate values +dotnet_diagnostic.CA1069.severity = suggestion + +# Do not declare event fields as virtual +dotnet_diagnostic.CA1070.severity = none + +# +# Documentation rules +# + +# Avoid using cref tags with a prefix +dotnet_diagnostic.CA1200.severity = none + +# +# Globalization rules +# + +# Do not pass literals as localized parameters +dotnet_diagnostic.CA1303.severity = none + +# Specify CultureInfo +dotnet_diagnostic.CA1304.severity = suggestion + +# Specify IFormatProvider +dotnet_diagnostic.CA1305.severity = warning + +# Specify StringComparison for clarity +dotnet_diagnostic.CA1307.severity = suggestion + +# Normalize strings to uppercase +dotnet_diagnostic.CA1308.severity = warning + +# Use ordinal StringComparison +dotnet_diagnostic.CA1309.severity = warning + +# Specify StringComparison for correctness +dotnet_diagnostic.CA1310.severity = suggestion + +# Specify a culture or use an invariant version +dotnet_diagnostic.CA1311.severity = none + +# +# Portability and interoperability rules +# + +# P/Invokes should not be visible +dotnet_diagnostic.CA1401.severity = suggestion + +# Validate platform compatibility (not set / default) +# dotnet_diagnostic.CA1416.severity = + +# Do not use OutAttribute on string parameters for P/Invokes +dotnet_diagnostic.CA1417.severity = suggestion + +# Use valid platform string +dotnet_diagnostic.CA1418.severity = suggestion + +# Provide a parameterless constructor that is as visible as the containing type for concrete types derived from 'System.Runtime.InteropServices.SafeHandle' +dotnet_diagnostic.CA1419.severity = none + +# Property, type, or attribute requires runtime marshalling +dotnet_diagnostic.CA1420.severity = warning + +# Method uses runtime marshalling when DisableRuntimeMarshallingAttribute is applied +dotnet_diagnostic.CA1421.severity = warning + +# Validate platform compatibility +dotnet_diagnostic.CA1422.severity = suggestion + +# +# Maintainability rules +# + +# Avoid excessive inheritance +dotnet_diagnostic.CA1501.severity = none + +# Avoid excessive complexity +dotnet_diagnostic.CA1502.severity = none + +# Avoid unmaintainable code +dotnet_diagnostic.CA1505.severity = none + +# Avoid excessive class coupling +dotnet_diagnostic.CA1506.severity = none + +# Use nameof in place of string +dotnet_diagnostic.CA1507.severity = warning + +# Avoid dead conditional code +dotnet_diagnostic.CA1508.severity = warning + +# Invalid entry in code metrics configuration file +dotnet_diagnostic.CA1509.severity = none + +# +# Naming rules +# + +# Do not name enum values 'Reserved' +dotnet_diagnostic.CA1700.severity = none + +# Identifiers should not contain underscores +dotnet_diagnostic.CA1707.severity = none + +# Identifiers should differ by more than case +dotnet_diagnostic.CA1708.severity = none + +# Identifiers should have correct suffix +dotnet_diagnostic.CA1710.severity = none + +# Identifiers should not have incorrect suffix +dotnet_diagnostic.CA1711.severity = none + +# Do not prefix enum values with type name +dotnet_diagnostic.CA1712.severity = suggestion + +# Events should not have before or after prefix +dotnet_diagnostic.CA1713.severity = suggestion + +# Flags enums should have plural names +dotnet_diagnostic.CA1714.severity = none + +# Identifiers should have correct prefix +dotnet_diagnostic.CA1715.severity = warning + +# Identifiers should not match keywords +dotnet_diagnostic.CA1716.severity = none + +# Only FlagsAttribute enums should have plural names +dotnet_diagnostic.CA1717.severity = none + +# Identifiers should not contain type names +dotnet_diagnostic.CA1720.severity = none + +# Property names should not match get methods +dotnet_diagnostic.CA1721.severity = none + +# Type Names Should Not Match Namespaces +dotnet_diagnostic.CA1724.severity = none + +# Parameter names should match base declaration +dotnet_diagnostic.CA1725.severity = none + +# Use PascalCase for named placeholders +dotnet_diagnostic.CA1727.severity = suggestion + +# +# Performance rules +# + +# Use Literals Where Appropriate +dotnet_diagnostic.CA1802.severity = none + +# Do not initialize unnecessarily +dotnet_diagnostic.CA1805.severity = none + +# Do not ignore method results +dotnet_diagnostic.CA1806.severity = none + +# Initialize reference type static fields inline +dotnet_diagnostic.CA1810.severity = none + +# Avoid uninstantiated internal classes +dotnet_diagnostic.CA1812.severity = suggestion + +# Avoid unsealed attributes +dotnet_diagnostic.CA1813.severity = suggestion + +# Prefer jagged arrays over multidimensional +dotnet_diagnostic.CA1814.severity = none + +# Override equals and operator equals on value types +dotnet_diagnostic.CA1815.severity = none + +# Properties should not return arrays +dotnet_diagnostic.CA1819.severity = none + +# Test for empty strings using string length +dotnet_diagnostic.CA1820.severity = suggestion + +# Remove empty finalizers +dotnet_diagnostic.CA1821.severity = warning + +# Mark members as static +dotnet_diagnostic.CA1822.severity = suggestion + +# Avoid unused private fields +dotnet_diagnostic.CA1823.severity = warning + +# Mark assemblies with NeutralResourcesLanguageAttribute +dotnet_diagnostic.CA1824.severity = none + +# Avoid zero-length array allocations +dotnet_diagnostic.CA1825.severity = suggestion + +# Use property instead of Linq Enumerable method +dotnet_diagnostic.CA1826.severity = none + +# Do not use Count/LongCount when Any can be used +dotnet_diagnostic.CA1827.severity = suggestion + +# Do not use CountAsync/LongCountAsync when AnyAsync can be used +dotnet_diagnostic.CA1828.severity = suggestion + +# Use Length/Count property instead of Enumerable.Count method +dotnet_diagnostic.CA1829.severity = suggestion + +# Prefer strongly-typed Append and Insert method overloads on StringBuilder +dotnet_diagnostic.CA1830.severity = none + +# Use AsSpan instead of Range-based indexers for string when appropriate +dotnet_diagnostic.CA1831.severity = suggestion + +# Use AsSpan or AsMemory instead of Range-based indexers for getting ReadOnlySpan or ReadOnlyMemory portion of an array +dotnet_diagnostic.CA1832.severity = suggestion + +# Use AsSpan or AsMemory instead of Range-based indexers for getting Span or Memory portion of an array +dotnet_diagnostic.CA1833.severity = suggestion + +# Use StringBuilder.Append(char) for single character strings +dotnet_diagnostic.CA1834.severity = suggestion + +# Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync' +dotnet_diagnostic.CA1835.severity = suggestion + +# Prefer IsEmpty over Count when available +dotnet_diagnostic.CA1836.severity = suggestion + +# Use Environment.ProcessId instead of Process.GetCurrentProcess().Id +dotnet_diagnostic.CA1837.severity = suggestion + +# Avoid StringBuilder parameters for P/Invokes +dotnet_diagnostic.CA1838.severity = suggestion + +# Use Environment.ProcessPath instead of Process.GetCurrentProcess().MainModule.FileName +dotnet_diagnostic.CA1839.severity = suggestion + +# Use Environment.CurrentManagedThreadId instead of Thread.CurrentThread.ManagedThreadId +dotnet_diagnostic.CA1840.severity = suggestion + +# Prefer Dictionary Contains methods +dotnet_diagnostic.CA1841.severity = suggestion + +# Do not use 'WhenAll' with a single task +dotnet_diagnostic.CA1842.severity = suggestion + +# Do not use 'WaitAll' with a single task +dotnet_diagnostic.CA1843.severity = suggestion + +# Provide memory-based overrides of async methods when subclassing 'Stream' +dotnet_diagnostic.CA1844.severity = none + +# Use span-based 'string.Concat' +dotnet_diagnostic.CA1845.severity = suggestion + +# Prefer AsSpan over Substring +dotnet_diagnostic.CA1846.severity = suggestion + +# Use char literal for a single character lookup +dotnet_diagnostic.CA1847.severity = suggestion + +# Use the LoggerMessage delegates +dotnet_diagnostic.CA1848.severity = suggestion + +# Call async methods when in an async method +dotnet_diagnostic.CA1849.severity = warning + +# Prefer static HashData method over ComputeHash +dotnet_diagnostic.CA1850.severity = suggestion + +# Possible multiple enumerations of IEnumerable collection +dotnet_diagnostic.CA1851.severity = warning + +# Seal internal types +dotnet_diagnostic.CA1852.severity = none + +# Unnecessary call to 'Dictionary.ContainsKey(key)' +dotnet_diagnostic.CA1853.severity = suggestion + +# Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method +dotnet_diagnostic.CA1854.severity = suggestion + +# Use Span.Clear() instead of Span.Fill() +dotnet_diagnostic.CA1855.severity = suggestion + +# Use StartsWith instead of IndexOf +dotnet_diagnostic.CA1858.severity = suggestion + +# Avoid using 'Enumerable.Any()' extension method +dotnet_diagnostic.CA1860.severity = none + + +# +# Performance rules +# + +# Dispose objects before losing scope +dotnet_diagnostic.CA2000.severity = warning + +# Do not lock on objects with weak identity +dotnet_diagnostic.CA2002.severity = none + +# Do not directly await a Task +dotnet_diagnostic.CA2007.severity = none + +# Do not create tasks without passing a TaskScheduler +dotnet_diagnostic.CA2008.severity = none + +# Do not call ToImmutableCollection on an ImmutableCollection value +dotnet_diagnostic.CA2009.severity = suggestion + +# Do not assign property within its setter +dotnet_diagnostic.CA2011.severity = error + +# Use ValueTasks correctly +dotnet_diagnostic.CA2012.severity = suggestion + +# Do not use ReferenceEquals with value types +dotnet_diagnostic.CA2013.severity = warning + +# Do not use stackalloc in loops. +dotnet_diagnostic.CA2014.severity = warning + +# Do not define finalizers for types derived from MemoryManager +dotnet_diagnostic.CA2015.severity = warning + +# Forward the CancellationToken parameter to methods that take one +dotnet_diagnostic.CA2016.severity = suggestion + +# Parameter count mismatch +dotnet_diagnostic.CA2017.severity = warning + +# The count argument to Buffer.BlockCopy should specify the number of bytes to copy +dotnet_diagnostic.CA2018.severity = suggestion + +# ThreadStatic fields should not use inline initialization +dotnet_diagnostic.CA2019.severity = suggestion + +# Prevent behavioral change caused by built-in operators of IntPtr/UIntPtr +dotnet_diagnostic.CA2020.severity = warning + +# +# Security rules +# + +# Review SQL queries for security vulnerabilities +dotnet_diagnostic.CA2100.severity = warning + +# Review visible event handlers +dotnet_diagnostic.CA2109.severity = none + +# Seal methods that satisfy private interfaces +dotnet_diagnostic.CA2119.severity = none + +# Avoid Handling Corrupted State Exceptions +dotnet_diagnostic.CA2153.severity = none + +# Do not use insecure deserializer BinaryFormatter +dotnet_diagnostic.CA2300.severity = warning + +# Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder +dotnet_diagnostic.CA2301.severity = warning + +# Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize +dotnet_diagnostic.CA2302.severity = warning + +# Do not use insecure deserializer LosFormatter +dotnet_diagnostic.CA2305.severity = warning + +# Do not use insecure deserializer NetDataContractSerializer +dotnet_diagnostic.CA2310.severity = warning + +# Do not deserialize without first setting NetDataContractSerializer.Binder +dotnet_diagnostic.CA2311.severity = warning + +# Ensure NetDataContractSerializer.Binder is set before deserializing +dotnet_diagnostic.CA2312.severity = warning + +# Do not use insecure deserializer ObjectStateFormatter +dotnet_diagnostic.CA2315.severity = warning + +# Do not deserialize with JavaScriptSerializer using a SimpleTypeResolver +dotnet_diagnostic.CA2321.severity = warning + +# Ensure JavaScriptSerializer is not initialized with SimpleTypeResolver before deserializing +dotnet_diagnostic.CA2322.severity = warning + +# Do not use TypeNameHandling values other than None +dotnet_diagnostic.CA2326.severity = warning + +# Do not use insecure JsonSerializerSettings +dotnet_diagnostic.CA2327.severity = warning + +# Ensure that JsonSerializerSettings are secure +dotnet_diagnostic.CA2328.severity = warning + +# Do not deserialize with JsonSerializer using an insecure configuration +dotnet_diagnostic.CA2329.severity = warning + +# Ensure that JsonSerializer has a secure configuration when deserializing +dotnet_diagnostic.CA2330.severity = warning + +# Ensure DataTable.ReadXml()'s input is trusted +dotnet_diagnostic.CA2350.severity = warning + +# Ensure DataSet.ReadXml()'s input is trusted +dotnet_diagnostic.CA2351.severity = warning + +# Unsafe DataSet or DataTable in serializable type can be vulnerable to remote code execution attacks +dotnet_diagnostic.CA2352.severity = warning + +# Unsafe DataSet or DataTable in serializable type +dotnet_diagnostic.CA2353.severity = warning + +# Unsafe DataSet or DataTable in deserialized object graph can be vulnerable to remote code execution attack +dotnet_diagnostic.CA2354.severity = warning + +# Unsafe DataSet or DataTable in deserialized object graph +dotnet_diagnostic.CA2355.severity = warning + +# Unsafe DataSet or DataTable in web deserialized object graph +dotnet_diagnostic.CA2356.severity = warning + +# Ensure autogenerated class containing DataSet.ReadXml() is not used with untrusted data +dotnet_diagnostic.CA2361.severity = warning + +# Unsafe DataSet or DataTable in autogenerated serializable type can be vulnerable to remote code execution attacks +dotnet_diagnostic.CA2362.severity = warning + +# Review code for SQL injection vulnerabilities +dotnet_diagnostic.CA3001.severity = warning + +# Review code for XSS vulnerabilities +dotnet_diagnostic.CA3002.severity = warning + +# Review code for file path injection vulnerabilities +dotnet_diagnostic.CA3003.severity = warning + +# Review code for information disclosure vulnerabilities +dotnet_diagnostic.CA3004.severity = warning + +# Review code for LDAP injection vulnerabilities +dotnet_diagnostic.CA3005.severity = warning + +# Review code for process command injection vulnerabilities +dotnet_diagnostic.CA3006.severity = warning + +# Review code for open redirect vulnerabilities +dotnet_diagnostic.CA3007.severity = warning + +# Review code for XPath injection vulnerabilities +dotnet_diagnostic.CA3008.severity = warning + +# Review code for XML injection vulnerabilities +dotnet_diagnostic.CA3009.severity = warning + +# Review code for XAML injection vulnerabilities +dotnet_diagnostic.CA3010.severity = warning + +# Review code for DLL injection vulnerabilities +dotnet_diagnostic.CA3011.severity = warning + +# Review code for regex injection vulnerabilities +dotnet_diagnostic.CA3012.severity = warning + +# Do not add schema by URL +dotnet_diagnostic.CA3061.severity = warning + +# Insecure DTD Processing +dotnet_diagnostic.CA3075.severity = warning + +# Insecure XSLT Script Execution +dotnet_diagnostic.CA3076.severity = warning + +# Insecure Processing in API Design, XML Document and XML Text Reader +dotnet_diagnostic.CA3077.severity = warning + +# Mark verb handlers with ValidateAntiForgeryToken +dotnet_diagnostic.CA3147.severity = warning + +# Do Not Use Weak Cryptographic Algorithms +dotnet_diagnostic.CA5350.severity = warning + +# Do Not Use Broken Cryptographic Algorithms +dotnet_diagnostic.CA5351.severity = warning + +# Do Not Use Unsafe Cipher Modes +dotnet_diagnostic.CA5358.severity = warning + +# Do not disable certificate validation +dotnet_diagnostic.CA5359.severity = warning + +# Do not call dangerous methods in deserialization +dotnet_diagnostic.CA5360.severity = warning + +# Do not disable SChannel use of strong crypto +dotnet_diagnostic.CA5361.severity = warning + +# Potential reference cycle in deserialized object graph +dotnet_diagnostic.CA5362.severity = warning + +# Do not disable request validation +dotnet_diagnostic.CA5363.severity = warning + +# Do not use deprecated security protocols +dotnet_diagnostic.CA5364.severity = warning + +# Do Not Disable HTTP Header Checking +dotnet_diagnostic.CA5365.severity = warning + +# Use XmlReader For DataSet Read XML +dotnet_diagnostic.CA5366.severity = warning + +# Do Not Serialize Types With Pointer Fields +dotnet_diagnostic.CA5367.severity = warning + +# Set ViewStateUserKey For Classes Derived From Page +dotnet_diagnostic.CA5368.severity = warning + +# Use XmlReader for Deserialize +dotnet_diagnostic.CA5369.severity = warning + +# Use XmlReader for validating reader +dotnet_diagnostic.CA5370.severity = warning + +# Use XmlReader for schema read +dotnet_diagnostic.CA5371.severity = warning + +# Use XmlReader for XPathDocument +dotnet_diagnostic.CA5372.severity = warning + +# Do not use obsolete key derivation function +dotnet_diagnostic.CA5373.severity = warning + +# Do Not Use XslTransform +dotnet_diagnostic.CA5374.severity = warning + +# Do not use account shared access signature +dotnet_diagnostic.CA5375.severity = warning + +# Use SharedAccessProtocol HttpsOnly +dotnet_diagnostic.CA5376.severity = warning + +# Use container level access policy +dotnet_diagnostic.CA5377.severity = warning + +# Do not disable ServicePointManagerSecurityProtocols +dotnet_diagnostic.CA5378.severity = warning + +# Ensure key derivation function algorithm is sufficiently strong +dotnet_diagnostic.CA5379.severity = warning + +# Do not add certificates to root store +dotnet_diagnostic.CA5380.severity = warning + +# Ensure certificates are not added to root store +dotnet_diagnostic.CA5381.severity = warning + +# Use secure cookies in ASP.NET Core +dotnet_diagnostic.CA5382.severity = warning + +# Ensure use secure cookies in ASP.NET Core +dotnet_diagnostic.CA5383.severity = warning + +# Do not use digital signature algorithm (DSA) +dotnet_diagnostic.CA5384.severity = warning + +# Use Rivest–Shamir–Adleman (RSA) algorithm with sufficient key size +dotnet_diagnostic.CA5385.severity = warning + +# Avoid hardcoding SecurityProtocolType value +dotnet_diagnostic.CA5386.severity = warning + +# Do not use weak key derivation function with insufficient iteration count +dotnet_diagnostic.CA5387.severity = warning + +# Ensure sufficient iteration count when using weak key derivation function +dotnet_diagnostic.CA5388.severity = warning + +# Do not add archive item's path to the target file system path +dotnet_diagnostic.CA5389.severity = warning + +# Do not hard-code encryption key +dotnet_diagnostic.CA5390.severity = warning + +# Use antiforgery tokens in ASP.NET Core MVC controllers +dotnet_diagnostic.CA5391.severity = warning + +# Use DefaultDllImportSearchPaths attribute for P/Invokes +dotnet_diagnostic.CA5392.severity = warning + +# Do not use unsafe DllImportSearchPath value +dotnet_diagnostic.CA5393.severity = warning + +# Do not use insecure randomness +dotnet_diagnostic.CA5394.severity = warning + +# Miss HttpVerb attribute for action methods +dotnet_diagnostic.CA5395.severity = warning + +# Set HttpOnly to true for HttpCookie +dotnet_diagnostic.CA5396.severity = warning + +# Do not use deprecated SslProtocols values +dotnet_diagnostic.CA5397.severity = warning + +# Avoid hardcoded SslProtocols values +dotnet_diagnostic.CA5398.severity = warning + +# Definitely disable HttpClient certificate revocation list check +dotnet_diagnostic.CA5399.severity = warning + +# Ensure HttpClient certificate revocation list check is not disabled +dotnet_diagnostic.CA5400.severity = warning + +# Do not use CreateEncryptor with non-default IV +dotnet_diagnostic.CA5401.severity = warning + +# Use CreateEncryptor with the default IV +dotnet_diagnostic.CA5402.severity = warning + +# Do not hard-code certificate +dotnet_diagnostic.CA5403.severity = warning + +# Do not disable token validation checks +dotnet_diagnostic.CA5404.severity = warning + +# Do not always skip token validation in delegates +dotnet_diagnostic.CA5405.severity = warning + +# +# Usage rules +# + +# Review unused parameters +dotnet_diagnostic.CA1801.severity = warning + +# Call GC.SuppressFinalize correctly +dotnet_diagnostic.CA1816.severity = warning + +# Rethrow to preserve stack details +dotnet_diagnostic.CA2200.severity = warning + +# Do not raise reserved exception types +dotnet_diagnostic.CA2201.severity = none + +# Initialize value type static fields inline +dotnet_diagnostic.CA2207.severity = suggestion + +# Instantiate argument exceptions correctly +dotnet_diagnostic.CA2208.severity = suggestion + +# Non-constant fields should not be visible +dotnet_diagnostic.CA2211.severity = none + +# Disposable fields should be disposed +dotnet_diagnostic.CA2213.severity = warning + +# Do not call overridable methods in constructors +dotnet_diagnostic.CA2214.severity = warning + +# Dispose methods should call base class dispose +dotnet_diagnostic.CA2215.severity = warning + +# Disposable types should declare finalizer +dotnet_diagnostic.CA2216.severity = warning + +# Do not mark enums with FlagsAttribute +dotnet_diagnostic.CA2217.severity = warning + +# Override GetHashCode on overriding Equals +dotnet_diagnostic.CA2218.severity = error + +# Do not raise exceptions in exception clauses +dotnet_diagnostic.CA2219.severity = warning + +# Override equals on overloading operator equals +dotnet_diagnostic.CA2224.severity = none + +# Operator overloads have named alternates +dotnet_diagnostic.CA2225.severity = none + +# Operators should have symmetrical overloads +dotnet_diagnostic.CA2226.severity = none + +# Collection properties should be read only +dotnet_diagnostic.CA2227.severity = none + +# Implement serialization constructors +dotnet_diagnostic.CA2229.severity = none + +# Overload operator equals on overriding ValueType.Equals +dotnet_diagnostic.CA2231.severity = suggestion + +# Pass System.Uri objects instead of strings +dotnet_diagnostic.CA2234.severity = none + +# Mark all non-serializable fields +dotnet_diagnostic.CA2235.severity = none + +# Mark ISerializable types with SerializableAttribute +dotnet_diagnostic.CA2237.severity = warning + +# Provide correct arguments to formatting methods +dotnet_diagnostic.CA2241.severity = warning + +# Test for NaN correctly +dotnet_diagnostic.CA2242.severity = warning + +# Attribute string literals should parse correctly +dotnet_diagnostic.CA2243.severity = none + +# Do not duplicate indexed element initializations +dotnet_diagnostic.CA2244.severity = suggestion + +# Do not assign a property to itself +dotnet_diagnostic.CA2245.severity = suggestion + +# Do not assign a symbol and its member in the same statement +dotnet_diagnostic.CA2246.severity = warning + +# Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum +dotnet_diagnostic.CA2247.severity = warning + +# Provide correct 'enum' argument to 'Enum.HasFlag' +dotnet_diagnostic.CA2248.severity = warning + +# Consider using String.Contains instead of String.IndexOf +dotnet_diagnostic.CA2249.severity = suggestion + +# Use ThrowIfCancellationRequested +dotnet_diagnostic.CA2250.severity = none + +# Use String.Equals over String.Compare +dotnet_diagnostic.CA2251.severity = suggestion + +# Opt in to preview features +dotnet_diagnostic.CA2252.severity = none + +# Named placeholders should not be numeric values +dotnet_diagnostic.CA2253.severity = warning + +# Template should be a static expression +dotnet_diagnostic.CA2254.severity = warning + +# The ModuleInitializer attribute should not be used in libraries +dotnet_diagnostic.CA2255.severity = none + +# All members declared in parent interfaces must have an implementation in a DynamicInterfaceCastableImplementation-attributed interface +dotnet_diagnostic.CA2256.severity = warning + +# Members defined on an interface with 'DynamicInterfaceCastableImplementationAttribute' should be 'static' +dotnet_diagnostic.CA2257.severity = warning + +# Providing a 'DynamicInterfaceCastableImplementation' interface in Visual Basic is unsupported +dotnet_diagnostic.CA2258.severity = none + +# Ensure ThreadStatic is only used with static fields +dotnet_diagnostic.CA2259.severity = suggestion + +# Implement generic math interfaces correctly +dotnet_diagnostic.CA2260.severity = Warning + +# +# Other rules +# + +# Analyzer version mismatch +dotnet_diagnostic.CA9999.severity = Warning + +# +# SingleFile rules +# + +# Avoid accessing Assembly file path when publishing as a single file +dotnet_diagnostic.IL3000.severity = none + +# Avoid accessing Assembly file path when publishing as a single file +dotnet_diagnostic.IL3001.severity = none + +# Avoid calling members annotated with 'RequiresAssemblyFilesAttribute' when publishing as a single file +dotnet_diagnostic.IL3002.severity = none + +# 'RequiresAssemblyFilesAttribute' annotations must match across all interface implementations or overrides. +dotnet_diagnostic.IL3003.severity = none diff --git a/src/BBT.StructureTools.Extensions/BBT.StructureTools.Extensions.csproj b/src/BBT.StructureTools.Extensions/BBT.StructureTools.Extensions.csproj index 83b53d56..8546c268 100644 --- a/src/BBT.StructureTools.Extensions/BBT.StructureTools.Extensions.csproj +++ b/src/BBT.StructureTools.Extensions/BBT.StructureTools.Extensions.csproj @@ -1,21 +1,16 @@ - + - netstandard2.0;net6.0 + netstandard2.0;net10.0 BBT.StructureTools.Extensions - ..\BBT.StructureTools.ruleset bin\$(Configuration)\BBT.StructureTools.xml - bin\$(Configuration)\ true BBT StructureTools Extensions Extensions to BBT.StructureTools (e.g. implementations of ICreateConvertHelper and IConvertHelperFactory interfaces). - BBT.StructureTools - BBT Software AG BBT Software AG - Copyright © BBT Software AG BBT.StructureTools.Extensions StructureTools Functional icon.png @@ -28,20 +23,19 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb;.xml - - full - - - - pdbonly - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/BBT.StructureTools.Tests.ruleset b/src/BBT.StructureTools.Tests.ruleset deleted file mode 100644 index 757caa6b..00000000 --- a/src/BBT.StructureTools.Tests.ruleset +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/BBT.StructureTools.Tests/BBT.StructureTools.Tests.csproj b/src/BBT.StructureTools.Tests/BBT.StructureTools.Tests.csproj index 09a41a83..a869873c 100644 --- a/src/BBT.StructureTools.Tests/BBT.StructureTools.Tests.csproj +++ b/src/BBT.StructureTools.Tests/BBT.StructureTools.Tests.csproj @@ -1,44 +1,33 @@ - + - net6.0 + net10.0 false BBT.StructureTools.Tests - BBT Software AG - BBT.StructureTools Tests for BBT.StructureTools - Copyright © BBT Software AG - ..\BBT.StructureTools.Tests.ruleset - bin\$(Configuration)\ - - - - full - - - pdbonly - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - + all + runtime; build; native; contentfiles; analyzers; buildtransitive - + + + + + all - + all - + all diff --git a/src/BBT.StructureTools.Tests/Compare/ComparerWithObjectAttributeTests.cs b/src/BBT.StructureTools.Tests/Compare/ComparerWithObjectAttributeTests.cs index 8c1d5765..d1b82254 100644 --- a/src/BBT.StructureTools.Tests/Compare/ComparerWithObjectAttributeTests.cs +++ b/src/BBT.StructureTools.Tests/Compare/ComparerWithObjectAttributeTests.cs @@ -6,7 +6,7 @@ using BBT.StructureTools.Compare.Helper; using BBT.StructureTools.Tests.Compare.Intention; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -15,7 +15,6 @@ /// public class ComparerWithObjectAttributeTests { - #region Members, Setup private readonly IComparer testCandidate; public ComparerWithObjectAttributeTests() @@ -27,8 +26,6 @@ public ComparerWithObjectAttributeTests() this.testCandidate = kernel.Get>(); } - #endregion - [Fact] public void Equals_WhenSameInstance_MustReturnTrue() { @@ -43,7 +40,7 @@ public void Equals_WhenSameInstance_MustReturnTrue() var result = this.testCandidate.Equals(testClass, testClass); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } [Fact] @@ -60,7 +57,7 @@ public void Equals_WhenSameInstanceAndObjectAttributeNull_MustReturnTrue() var result = this.testCandidate.Equals(testClass, testClass); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } [Fact] @@ -75,7 +72,7 @@ public void Equals_WhenAttributeObjectsEqual_MustReturnTrue() var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } [Fact] @@ -91,7 +88,7 @@ public void Equals_WhenAttributeObjectsNotEqual_MustReturnFalse() var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeFalse(); + result.ShouldBeFalse(); } [Fact] @@ -106,7 +103,7 @@ public void Equals_WhenAttributeObjectsNotEqualButNotRegistered_MustReturnTrue() var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } [Fact] @@ -127,10 +124,9 @@ public void Equals_WhenAttributeObjectsNotEqualButExcluded_MustReturnTrue() var result = this.testCandidate.Equals(testClassA, testClassB, System.Array.Empty(), comparerExclusions); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } - #region private test classes and test class helpers private class TestClass { public TestAttribute TestAttribute1 { get; set; } @@ -146,11 +142,10 @@ private class TestClassCompareRegistrations : ICompareRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterAttribute(x => x.TestAttribute1); } } - #endregion } } diff --git a/src/BBT.StructureTools.Tests/Compare/ComparerWithObjectAttributeWithDistinguishedComparerIntTests.cs b/src/BBT.StructureTools.Tests/Compare/ComparerWithObjectAttributeWithDistinguishedComparerIntTests.cs index 834fb592..5b159559 100644 --- a/src/BBT.StructureTools.Tests/Compare/ComparerWithObjectAttributeWithDistinguishedComparerIntTests.cs +++ b/src/BBT.StructureTools.Tests/Compare/ComparerWithObjectAttributeWithDistinguishedComparerIntTests.cs @@ -7,14 +7,12 @@ using BBT.StructureTools.Compare.Helper; using BBT.StructureTools.Tests.Compare.Intention; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; public class ComparerWithObjectAttributeWithDistinguishedComparerIntTests { - #region Members, Setup - private static IComparer distinguishedComparer; private readonly IComparer testCandidate; @@ -29,7 +27,6 @@ public ComparerWithObjectAttributeWithDistinguishedComparerIntTests() this.testCandidate = kernel.Get>(); } - #endregion /// /// Tests IComparer.Equals. @@ -48,7 +45,7 @@ public void Equals_WhenSameInstance_MustReturnTrue() var result = this.testCandidate.Equals(testClass, testClass); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -68,7 +65,7 @@ public void Equals_WhenSameInstanceAndObjectAttributeNull_MustReturnTrue() var result = this.testCandidate.Equals(testClass, testClass); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -86,7 +83,7 @@ public void Equals_WhenAttributeObjectsEqual_MustReturnTrue() var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -105,7 +102,7 @@ public void Equals_WhenBaseModelAttributeObjectsNotEqualButHaveSameValue_MustRet var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -124,7 +121,7 @@ public void Equals_WhenBaseModelAttributeObjectsNotEqualAndHaveDifferentValue_Mu var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeFalse(); + result.ShouldBeFalse(); } /// @@ -143,7 +140,7 @@ public void Equals_WhenAttributeObjectsNotEqualButNotRegistered_MustReturnTrue() var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -167,11 +164,9 @@ public void Equals_WhenAttributeObjectsNotEqualButExcluded_MustReturnTrue() var result = this.testCandidate.Equals(testClassA, testClassB, Array.Empty(), comparerExclusions); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } - #region private test classes and test class helpers - private class TestClass { public TestAttribute TestAttribute { get; set; } @@ -188,7 +183,7 @@ private class TestAttributeCompareRegistrations : ICompareRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterAttribute(x => x.TestValue1); } @@ -198,14 +193,12 @@ private class TestClassCompareRegistrations : ICompareRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterAttributeWithDistinguishedComparer( x => x.TestAttribute, ComparerWithObjectAttributeWithDistinguishedComparerIntTests.distinguishedComparer); } } - - #endregion } } diff --git a/src/BBT.StructureTools.Tests/Compare/ComparerWithObjectsAndValueAttributesTests.cs b/src/BBT.StructureTools.Tests/Compare/ComparerWithObjectsAndValueAttributesTests.cs index 5e6e1703..4d7a421a 100644 --- a/src/BBT.StructureTools.Tests/Compare/ComparerWithObjectsAndValueAttributesTests.cs +++ b/src/BBT.StructureTools.Tests/Compare/ComparerWithObjectsAndValueAttributesTests.cs @@ -7,13 +7,12 @@ using BBT.StructureTools.Compare.Helper; using BBT.StructureTools.Tests.Compare.Intention; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; public class ComparerWithObjectsAndValueAttributesTests { - #region Members, Setup private readonly IComparer testCandidate; public ComparerWithObjectsAndValueAttributesTests() @@ -25,8 +24,6 @@ public ComparerWithObjectsAndValueAttributesTests() this.testCandidate = kernel.Get>(); } - #endregion - [Fact] public void Equals_WhenSameInstance_MustReturnTrue() { @@ -42,7 +39,7 @@ public void Equals_WhenSameInstance_MustReturnTrue() var result = this.testCandidate.Equals(testClass, testClass); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } [Fact] @@ -60,7 +57,7 @@ public void Equals_WhenSameInstanceAndObjectAttributeNullButValueNot_MustReturnT var result = this.testCandidate.Equals(testClass, testClass); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } [Fact] @@ -83,7 +80,7 @@ public void Equals_WhenAttributeObjectsAndValueEqual_MustReturnTrue() var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } [Fact] @@ -106,7 +103,7 @@ public void Equals_WhenAttributeObjectsButNotValueEqual_MustReturnFalse() var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeFalse(); + result.ShouldBeFalse(); } [Fact] @@ -130,7 +127,7 @@ public void Equals_WhenAttributeObjectsNotButValueEqual_MustReturnFalse() var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeFalse(); + result.ShouldBeFalse(); } [Fact] @@ -154,7 +151,7 @@ public void Equals_WhenAttributeObjectsAndValuesNotEqualButNotRegistered_MustRet var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } [Fact] @@ -185,10 +182,9 @@ public void Equals_WhenAttributeObjectsAndValuesNotEqualButExcluded_MustReturnTr var result = this.testCandidate.Equals(testClassA, testClassB, Array.Empty(), comparerExclusions); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } - #region private test classes and test class helpers private class TestClass { public TestAttribute TestAttribute1 { get; set; } @@ -208,13 +204,12 @@ private class TestClassCompareRegistrations : ICompareRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations .RegisterAttribute(x => x.TestAttribute1) .RegisterAttribute(x => x.TestValue1); } } - #endregion } } diff --git a/src/BBT.StructureTools.Tests/Compare/ComparerWithValueAttributeTests.cs b/src/BBT.StructureTools.Tests/Compare/ComparerWithValueAttributeTests.cs index 1623ed03..d67968b6 100644 --- a/src/BBT.StructureTools.Tests/Compare/ComparerWithValueAttributeTests.cs +++ b/src/BBT.StructureTools.Tests/Compare/ComparerWithValueAttributeTests.cs @@ -7,7 +7,7 @@ using BBT.StructureTools.Compare.Helper; using BBT.StructureTools.Tests.Compare.Intention; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -34,7 +34,7 @@ public void Equals_WhenSameInstance_MustReturnTrue() var result = this.testCandidate.Equals(testClass, testClass); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } [Fact] @@ -48,7 +48,7 @@ public void Equals_WhenAttributeValuesEqual_MustReturnTrue() var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } [Fact] @@ -62,7 +62,7 @@ public void Equals_WhenAttributeValuesNotEqual_MustReturnFalse() var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeFalse(); + result.ShouldBeFalse(); } [Fact] @@ -76,7 +76,7 @@ public void Equals_WhenAttributeValuesNotEqualButNotRegistered_MustReturnTrue() var result = this.testCandidate.Equals(testClassA, testClassB); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } [Fact] @@ -91,7 +91,7 @@ public void Equals_WhenAttributeValuesNotEqualButExcluded_MustReturnTrue() var result = this.testCandidate.Equals(testClassA, testClassB, Array.Empty(), comparerExclusions); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } private class TestClass @@ -105,7 +105,7 @@ private class TestClassCompareRegistrations : ICompareRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations .RegisterAttribute(x => x.Value1); diff --git a/src/BBT.StructureTools.Tests/Compare/SubComparerUsingComparerTests.cs b/src/BBT.StructureTools.Tests/Compare/SubComparerUsingComparerTests.cs index 974ce1dd..fb7a3473 100644 --- a/src/BBT.StructureTools.Tests/Compare/SubComparerUsingComparerTests.cs +++ b/src/BBT.StructureTools.Tests/Compare/SubComparerUsingComparerTests.cs @@ -7,13 +7,12 @@ using BBT.StructureTools.Compare.Helper; using BBT.StructureTools.Tests.Compare.Intention; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; public class SubComparerUsingComparerTests { - #region Members, Setup private static IComparer parentCompare; private readonly IComparer testCandidate; @@ -28,7 +27,6 @@ public SubComparerUsingComparerTests() this.testCandidate = kernel.Get>(); } - #endregion /// /// Tests equals. @@ -43,7 +41,7 @@ public void Equals_SameInstance_MustReturnTrue() var result = this.testCandidate.Equals(testClass, testClass); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -66,7 +64,7 @@ public void Equals_DifferentInstancesSameAttributes_MustReturnTrue() var result = this.testCandidate.Equals(testClass, testClass2); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -89,7 +87,7 @@ public void Equals_DifferentInstancesNotSameAttributes_MustReturnFalse() var result = this.testCandidate.Equals(testClass, testClass2); // Assert - result.Should().BeFalse(); + result.ShouldBeFalse(); } /// @@ -112,7 +110,7 @@ public void Equals_DifferentInstancesNotSameAttributesNotRegistered_MustReturnTr var result = this.testCandidate.Equals(testClass, testClass2); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -140,7 +138,7 @@ public void Equals_DifferentInstancesNotSameAttributesButExcludedByParent_MustRe var result = this.testCandidate.Equals(testClass, testClass2, Array.Empty(), comparerExclusions); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -168,11 +166,9 @@ public void Equals_DifferentInstancesNotSameAttributesButExcludedBySubCompareExc var result = this.testCandidate.Equals(testClass, testClass2, Array.Empty(), comparerExclusions); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } - #region private test classes and test class helpers - private class TestClassParent { public int TestValue1 { get; set; } @@ -188,7 +184,7 @@ private class TestClassParentCompareRegistrations : ICompareRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterAttribute(x => x.TestValue1); } @@ -198,12 +194,11 @@ private class TestClassChildCompareRegistrations : ICompareRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations .RegisterSubCompare(parentCompare); } } - #endregion } } diff --git a/src/BBT.StructureTools.Tests/Compare/ToManyComparerTests.cs b/src/BBT.StructureTools.Tests/Compare/ToManyComparerTests.cs index 16c78782..478812bf 100644 --- a/src/BBT.StructureTools.Tests/Compare/ToManyComparerTests.cs +++ b/src/BBT.StructureTools.Tests/Compare/ToManyComparerTests.cs @@ -6,13 +6,12 @@ using BBT.StructureTools.Initialization; using BBT.StructureTools.Tests.Compare.Intention; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; public class ToManyComparerTests { - #region Members, Setup private readonly IComparer comparer; public ToManyComparerTests() @@ -25,7 +24,6 @@ public ToManyComparerTests() this.comparer = kernel.Get>(); } - #endregion /// /// Tests the compare infrastructure. @@ -48,7 +46,7 @@ public void Compare_SameInstance_MustReturnTrue() var result = this.comparer.Equals(testClass, testClass); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -68,7 +66,7 @@ public void Compare_SameInstanceButistNull_MustReturnTrue() var result = this.comparer.Equals(testClass, testClass); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -101,7 +99,7 @@ public void Compare_DifferentInstancesSameist_MustReturnTrue() var result = this.comparer.Equals(testClass, testClass2); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -135,7 +133,7 @@ public void Compare_DifferentInstancesDifferentistsSameValues_MustReturnTrue() var result = this.comparer.Equals(testClass, testClass2); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -169,7 +167,7 @@ public void Compare_DifferentInstancesDifferentistsSameValuesDifferentistPositio var result = this.comparer.Equals(testClass, testClass2); // Assert - result.Should().BeTrue(); + result.ShouldBeTrue(); } /// @@ -203,7 +201,7 @@ public void Compare_DifferentInstancesDifferentistsDifferentValues_MustReturnFal var result = this.comparer.Equals(testClass, testClass2); // Assert - result.Should().BeFalse(); + result.ShouldBeFalse(); } /// @@ -236,11 +234,9 @@ public void Compare_DifferentInstancesDifferentistsDifferentValuesDifferentistCo var result = this.comparer.Equals(testClass, testClass2); // Assert - result.Should().BeFalse(); + result.ShouldBeFalse(); } - #region private test classes and test class helpers - private class TestClass { public List ListOfChildren { private get; set; } @@ -262,7 +258,7 @@ private class TestClassCompareRegistrations : ICompareRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterToManyRelationship( x => x.GetChildren(), @@ -274,11 +270,10 @@ private class TestClassistOfChildrenItecompareRegistrations : ICompareRegistrati { public void DoRegistrations(IEqualityComparerHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterAttribute(x => x.TestValue1); } } - #endregion } } diff --git a/src/BBT.StructureTools.Tests/Convert/ConverterIntTests.cs b/src/BBT.StructureTools.Tests/Convert/ConverterIntTests.cs index 6324c667..3f357dd9 100644 --- a/src/BBT.StructureTools.Tests/Convert/ConverterIntTests.cs +++ b/src/BBT.StructureTools.Tests/Convert/ConverterIntTests.cs @@ -16,7 +16,7 @@ using BBT.StructureTools.Tests.Convert.Registrations.WholeStructure; using BBT.StructureTools.Tests.Convert.TestData; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -25,7 +25,6 @@ /// public class ConverterIntTests { - #region Setup private static IKernel container; public ConverterIntTests() @@ -33,9 +32,7 @@ public ConverterIntTests() container = TestIocContainer.Initialize(); } - #endregion - #region Convert /// /// Tests the convert from root to leaf into target structure. @@ -92,8 +89,8 @@ public void Convert_CopyAttribute_Successful() converter.Convert(sourceTree, targetTree, processings); // Assert - targetTree.TreeName.Should().Be(sourceTree.TreeName); - targetTree.TemporalDataOriginId.Should().Be(targetTree.MasterDataId); + targetTree.TreeName.ShouldBe(sourceTree.TreeName); + targetTree.TemporalDataOriginId.ShouldBe(targetTree.MasterDataId); } /// @@ -120,7 +117,7 @@ public void Convert_CreateToManyWithReverseRelation_Successful() converter.Convert(sourceTree, targetTree, processings); // Assert - sourceTree.Leafs.Count.Should().Be(targetTree.TargetLeafs.Count); + sourceTree.Leafs.Count.ShouldBe(targetTree.TargetLeafs.Count); } /// @@ -147,7 +144,7 @@ public void Convert_CreateToManyWithGenericReverseRelation_Successful() converter.Convert(sourceTree, targetTree, processings); // Assert - sourceTree.Leafs.Count.Should().Be(targetTree.TargetLeafs.Count); + sourceTree.Leafs.Count.ShouldBe(targetTree.TargetLeafs.Count); } /// @@ -174,7 +171,7 @@ public void Convert_CreateToMany_Successful() converter.Convert(sourceTree, targetTree, processings); // Assert - sourceTree.Leafs.Count.Should().Be(targetTree.TargetLeafs.Count); + sourceTree.Leafs.Count.ShouldBe(targetTree.TargetLeafs.Count); } /// @@ -213,10 +210,10 @@ public void Convert_Processings_Successful() converter.Convert(sourceTree, targetTree, processings); // Assert - sourceTree.Leafs.Count.Should().Be(targetTree.TargetLeafs.Count); - targetIds.Should().BeEquivalentTo(targetTree.TargetLeafs.Select(x => x.Id).ToList()); - sourceIds.Should().BeEquivalentTo(sourceTree.Leafs.Select(x => x.Id).ToList()); - preProcHits.Should().Be(2); + sourceTree.Leafs.Count.ShouldBe(targetTree.TargetLeafs.Count); + targetIds.ShouldBe(targetTree.TargetLeafs.Select(x => x.Id).ToList(), ignoreOrder: true); + sourceIds.ShouldBe(sourceTree.Leafs.Select(x => x.Id).ToList(), ignoreOrder: true); + preProcHits.ShouldBe(2); } /// @@ -252,11 +249,11 @@ public void Convert_CreateToOneHistWithCondition_Successful() converter.Convert(sourceTree, targetTree, processings); // Assert - targetTree.TargetHists.Count.Should().Be(1); + targetTree.TargetHists.Count.ShouldBe(1); var targetHist = targetTree.TargetHists.Single(); - targetHist.OriginId.Should().Be(expFilteredHist.Id); - targetHist.From.Should().Be(expFilteredHist.From); - targetHist.To.Should().Be(expEndDate); + targetHist.OriginId.ShouldBe(expFilteredHist.Id); + targetHist.From.ShouldBe(expFilteredHist.From); + targetHist.To.ShouldBe(expEndDate); } /// @@ -285,7 +282,7 @@ public void Convert_CreateToManyFromGenericStrategyWithReverseRelation_Successfu converter.Convert(sourceRoot, targetRoot, processings); // Assert - targetRoot.TargetLeafs.Count.Should().Be(sourceRoot.Leafs.Count); + targetRoot.TargetLeafs.Count.ShouldBe(sourceRoot.Leafs.Count); } /// @@ -315,7 +312,7 @@ public void Convert_CreateToManyFromStrategyHelperWithReverseRelation_Successful converter.Convert(sourceRoot, targetRoot, processings); // Assert - targetRoot.TargetLeafs.Count.Should().Be(sourceRoot.Leafs.Count); + targetRoot.TargetLeafs.Count.ShouldBe(sourceRoot.Leafs.Count); } /// @@ -343,8 +340,8 @@ public void Convert_RegisterCreateToOneWithRelation_Successful() converter.Convert(sourceRoot, targetRoot, processings); // Assert - targetRoot.TargetTree.Should().NotBeNull(); - targetRoot.TargetTree.RelationOnTarget.Should().Be(targetRoot.RelationOnTarget); + targetRoot.TargetTree.ShouldNotBeNull(); + targetRoot.TargetTree.RelationOnTarget.ShouldBe(targetRoot.RelationOnTarget); } /// @@ -375,9 +372,9 @@ public void Convert_RegisterCreateToOneWithRelationAndTarget_Successful() converter.Convert(sourceRoot, targetRoot, processings); // Assert - targetRoot.TargetTree.Should().NotBeNull(); - targetRoot.TargetTree.RelationOnTarget.Should().Be(targetRoot.RelationOnTarget); - targetRoot.TargetTree.TemporalDataOriginId.Should().Be(targetRoot.Id); + targetRoot.TargetTree.ShouldNotBeNull(); + targetRoot.TargetTree.RelationOnTarget.ShouldBe(targetRoot.RelationOnTarget); + targetRoot.TargetTree.TemporalDataOriginId.ShouldBe(targetRoot.Id); } /// @@ -410,9 +407,9 @@ public void Convert_RegisterCreateToManyWithRelation_Successful() converter.Convert(sourceTree, targetTree, processings); // Assert - targetTree.TargetLeafs.Count.Should().Be(1); + targetTree.TargetLeafs.Count.ShouldBe(1); var targetLeaf = targetTree.TargetLeafs.Single(); - targetLeaf.RelationOnTarget.Should().Be(targetTree.RelationOnTarget); + targetLeaf.RelationOnTarget.ShouldBe(targetTree.RelationOnTarget); } /// @@ -445,10 +442,10 @@ public void Convert_RegisterCreateToManyWithRelationAndTarget_Successful() converter.Convert(sourceTree, targetTree, processings); // Assert - targetTree.TargetLeafs.Count.Should().Be(1); + targetTree.TargetLeafs.Count.ShouldBe(1); var targetLeaf = targetTree.TargetLeafs.Single(); - targetLeaf.RelationOnTarget.Should().Be(targetTree.RelationOnTarget); - targetLeaf.OriginId.Should().Be(targetTree.Id); + targetLeaf.RelationOnTarget.ShouldBe(targetTree.RelationOnTarget); + targetLeaf.OriginId.ShouldBe(targetTree.Id); } /// @@ -475,42 +472,38 @@ public void Convert_RegisterCreateToManyWithRelation_ReverseRelation_Successful( converter.Convert(sourceTree, targetTree, processings); // Assert - sourceTree.Leafs.Count.Should().Be(targetTree.TargetLeafs.Count); + sourceTree.Leafs.Count.ShouldBe(targetTree.TargetLeafs.Count); for (var i = 0; i < sourceTree.Leafs.Count; i++) { - targetTree.TargetLeafs[i].TargetTree.Should().Be(targetTree); - targetTree.TargetLeafs[i].OriginId.Should().Be(sourceTree.Leafs.ElementAt(i).Id); + targetTree.TargetLeafs[i].TargetTree.ShouldBe(targetTree); + targetTree.TargetLeafs[i].OriginId.ShouldBe(sourceTree.Leafs.ElementAt(i).Id); } } - #endregion - - #region Asserts - private static void AssertRoot(SourceRoot sourceRoot, TargetRoot targetRoot) { - targetRoot.OriginRoot.Should().Be(sourceRoot); - targetRoot.Name.Should().Be(sourceRoot.Name); - targetRoot.RootId.Should().Be(sourceRoot.Id); - targetRoot.Id.Should().Be(sourceRoot.Id); - targetRoot.TargetId.Should().Be(sourceRoot.Id); - targetRoot.NumberSourceDefault.Should().NotBe(sourceRoot.NumberSourceDefault); - targetRoot.NumberSourceNotDefault.Should().Be(sourceRoot.NumberSourceNotDefault); - targetRoot.NumberTargetDefault.Should().Be(sourceRoot.NumberTargetDefault); - targetRoot.NumberTargetNotDefault.Should().NotBe(sourceRoot.NumberTargetNotDefault); - targetRoot.NumberSourceLookedUp.Should().Be(sourceRoot.NumberSourceNotDefault); - targetRoot.NumberSourceNotLookedUp.Should().Be(sourceRoot.NumberSourceNotDefault); + targetRoot.OriginRoot.ShouldBe(sourceRoot); + targetRoot.Name.ShouldBe(sourceRoot.Name); + targetRoot.RootId.ShouldBe(sourceRoot.Id); + targetRoot.Id.ShouldBe(sourceRoot.Id); + targetRoot.TargetId.ShouldBe(sourceRoot.Id); + targetRoot.NumberSourceDefault.ShouldNotBe(sourceRoot.NumberSourceDefault); + targetRoot.NumberSourceNotDefault.ShouldBe(sourceRoot.NumberSourceNotDefault); + targetRoot.NumberTargetDefault.ShouldBe(sourceRoot.NumberTargetDefault); + targetRoot.NumberTargetNotDefault.ShouldNotBe(sourceRoot.NumberTargetNotDefault); + targetRoot.NumberSourceLookedUp.ShouldBe(sourceRoot.NumberSourceNotDefault); + targetRoot.NumberSourceNotLookedUp.ShouldBe(sourceRoot.NumberSourceNotDefault); // ToDo: Check is this a bug? see https://github.com/bbtsoftware/BBT.StructureTools/issues/65. // targetRoot.NumberLimitNotApplied.Should().Be(sourceRoot.NumberSourceDefault); - targetRoot.NumberLimitApplied.Should().NotBe(sourceRoot.NumberSourceNotDefault); - targetRoot.EnumValue.Should().Be(sourceRoot.EnumValue.Target); - targetRoot.FilteredHist.Should().Be(sourceRoot.Tree.ExpectedFilteredHist); - ((TargetDerivedLeaf)targetRoot.TargetLeaf).OriginId.Should().Be(((SourceDerivedLeaf)sourceRoot.Leaf).Id); + targetRoot.NumberLimitApplied.ShouldNotBe(sourceRoot.NumberSourceNotDefault); + targetRoot.EnumValue.ShouldBe(sourceRoot.EnumValue.Target); + targetRoot.FilteredHist.ShouldBe(sourceRoot.Tree.ExpectedFilteredHist); + ((TargetDerivedLeaf)targetRoot.TargetLeaf).OriginId.ShouldBe(((SourceDerivedLeaf)sourceRoot.Leaf).Id); - targetRoot.TargetMasterData.OriginId.Should().Be(sourceRoot.ExpectedFilteredMasterData.Id); - targetRoot.TargetMasterData.IsDefault.Should().Be(sourceRoot.ExpectedFilteredMasterData.IsDefault); - targetRoot.FilteredMasterDataId.Should().Be(sourceRoot.ExpectedFilteredMasterData.Id); + targetRoot.TargetMasterData.OriginId.ShouldBe(sourceRoot.ExpectedFilteredMasterData.Id); + targetRoot.TargetMasterData.IsDefault.ShouldBe(sourceRoot.ExpectedFilteredMasterData.IsDefault); + targetRoot.FilteredMasterDataId.ShouldBe(sourceRoot.ExpectedFilteredMasterData.Id); AssertTree(sourceRoot, targetRoot); } @@ -520,15 +513,15 @@ private static void AssertTree(SourceRoot sourceRoot, TargetRoot targetRoot) var sourceTree = sourceRoot.Tree; var targetTree = targetRoot.TargetTree; - targetRoot.TargetTreeId.Should().Be(targetTree.Id); - targetRoot.OriginTreeId.Should().Be(sourceTree.Id); - targetRoot.TreeId.Should().Be(sourceTree.Id); - targetTree.TargetRoot.Should().Be(targetRoot); - targetTree.OriginTree.Should().Be(sourceRoot.Tree); - targetTree.TreeName.Should().Be(sourceTree.TreeName); - targetTree.MasterDataId.Should().Be(sourceTree.MasterData.Id); - targetTree.TemporalDataOriginId.Should().Be(sourceTree.ExpectedFilteredHist.Id); - targetTree.BaseDataId.Should().Be(sourceTree.BaseDataId); + targetRoot.TargetTreeId.ShouldBe(targetTree.Id); + targetRoot.OriginTreeId.ShouldBe(sourceTree.Id); + targetRoot.TreeId.ShouldBe(sourceTree.Id); + targetTree.TargetRoot.ShouldBe(targetRoot); + targetTree.OriginTree.ShouldBe(sourceRoot.Tree); + targetTree.TreeName.ShouldBe(sourceTree.TreeName); + targetTree.MasterDataId.ShouldBe(sourceTree.MasterData.Id); + targetTree.TemporalDataOriginId.ShouldBe(sourceTree.ExpectedFilteredHist.Id); + targetTree.BaseDataId.ShouldBe(sourceTree.BaseDataId); AssertTreeLeafs(sourceTree, targetTree); AssertTreeHistLeafs(sourceTree, targetTree); @@ -536,46 +529,42 @@ private static void AssertTree(SourceRoot sourceRoot, TargetRoot targetRoot) private static void AssertTreeLeafs(SourceTree sourceTree, TargetTree targetTree) { - targetTree.TargetLeafs.Count.Should().Be(sourceTree.Leafs.Count); + targetTree.TargetLeafs.Count.ShouldBe(sourceTree.Leafs.Count); for (var i = 0; i < sourceTree.Leafs.Count; i++) { var targetLeaf = targetTree.TargetLeafs.ElementAt(i); - targetLeaf.TargetTree.Should().Be(targetTree); + targetLeaf.TargetTree.ShouldBe(targetTree); AssertTreeLeaf(sourceTree.Leafs.ElementAt(i), targetLeaf); } } private static void AssertTreeLeaf(SourceTreeLeaf sourceLeaf, TargetTreeLeaf targetLeaf) { - targetLeaf.OriginId.Should().Be(sourceLeaf.Id); - targetLeaf.MasterDataId.Should().Be(sourceLeaf.MasterDatas.First().Id); - targetLeaf.LeafName.Should().Be(sourceLeaf.LeafName); - targetLeaf.Child.OriginId.Should().Be(sourceLeaf.Id); + targetLeaf.OriginId.ShouldBe(sourceLeaf.Id); + targetLeaf.MasterDataId.ShouldBe(sourceLeaf.MasterDatas.First().Id); + targetLeaf.LeafName.ShouldBe(sourceLeaf.LeafName); + targetLeaf.Child.OriginId.ShouldBe(sourceLeaf.Id); } private static void AssertTreeHistLeafs(SourceTree sourceTree, TargetTree targetTree) { var sourceTreeHistLeafs = sourceTree.Leafs.SelectMany(x => x.TreeHistLeafs).ToList(); - targetTree.TargetHistLeafs.Count.Should().Be(sourceTreeHistLeafs.Count); + targetTree.TargetHistLeafs.Count.ShouldBe(sourceTreeHistLeafs.Count); for (var i = 0; i < sourceTreeHistLeafs.Count; i++) { var targetHistLeaf = targetTree.TargetHistLeafs.ElementAt(i); - targetHistLeaf.TargetTree.Should().Be(targetTree); + targetHistLeaf.TargetTree.ShouldBe(targetTree); AssertTreeHistLeaf(sourceTreeHistLeafs.ElementAt(i), targetHistLeaf); } } private static void AssertTreeHistLeaf(SourceTreeHistLeaf sourceHistLeaf, TargetTreeHistLeaf targetHistLeaf) { - targetHistLeaf.OriginTreeHistLeafId.Should().Be(sourceHistLeaf.TreeHistLeafId); + targetHistLeaf.OriginTreeHistLeafId.ShouldBe(sourceHistLeaf.TreeHistLeafId); } - #endregion - - #region Create test data - private static SourceRoot CreateSourceRoot() { var root = new SourceRoot() @@ -695,10 +684,6 @@ private static MasterData CreateSourceLeafMasterData( return sourceLeafMasterData; } - #endregion - - #region Do registrations - private static IConvert GetConverter() where TSource : class where TTarget : class @@ -740,7 +725,5 @@ private static void DoConvertRegistrationsForWholeStructure() container.Bind>().To>(); container.Bind>().To(); } - - #endregion } } diff --git a/src/BBT.StructureTools.Tests/Convert/CreateConvertFromStrategy/CreateConvertFromStrategyHelperFactoryTests.cs b/src/BBT.StructureTools.Tests/Convert/CreateConvertFromStrategy/CreateConvertFromStrategyHelperFactoryTests.cs index 222b87c9..498ec9ba 100644 --- a/src/BBT.StructureTools.Tests/Convert/CreateConvertFromStrategy/CreateConvertFromStrategyHelperFactoryTests.cs +++ b/src/BBT.StructureTools.Tests/Convert/CreateConvertFromStrategy/CreateConvertFromStrategyHelperFactoryTests.cs @@ -7,7 +7,7 @@ using BBT.StructureTools.Tests.Convert.Registrations.WholeStructure; using BBT.StructureTools.Tests.Convert.TestData; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -30,8 +30,8 @@ public void GetConvertHelper_NoReverseRelation_GetsExpectedTypes() var testCandidate = container.Get>(); var helper = testCandidate.GetConvertHelper(); - testCandidate.Should().BeOfType>(); - helper.Should().BeOfType>(); + testCandidate.ShouldBeOfType>(); + helper.ShouldBeOfType>(); } [Fact] @@ -44,8 +44,8 @@ public void GetConvertHelper_WithReverseRelation_GetsExpectedTypes() var testCandidate = container.Get>(); var helper = testCandidate.GetConvertHelper(x => x.TargetRoot); - testCandidate.Should().BeOfType>(); - helper.Should().BeOfType>(); + testCandidate.ShouldBeOfType>(); + helper.ShouldBeOfType>(); } } } diff --git a/src/BBT.StructureTools.Tests/Convert/CreateConvertFromStrategy/CreateConvertFromStrategyHelperTests.cs b/src/BBT.StructureTools.Tests/Convert/CreateConvertFromStrategy/CreateConvertFromStrategyHelperTests.cs index e7657cae..99352f6b 100644 --- a/src/BBT.StructureTools.Tests/Convert/CreateConvertFromStrategy/CreateConvertFromStrategyHelperTests.cs +++ b/src/BBT.StructureTools.Tests/Convert/CreateConvertFromStrategy/CreateConvertFromStrategyHelperTests.cs @@ -9,7 +9,7 @@ using BBT.StructureTools.Tests.Convert.Registrations.WholeStructure; using BBT.StructureTools.Tests.Convert.TestData; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -37,9 +37,9 @@ public void CreateTarget_NoReverseRelation_CreateAndConvert() var target = testCandidate.Create(source); testCandidate.Convert(source, target, processings); - target.Should().NotBeNull(); - target.Should().BeOfType(); - ((TargetDerivedLeaf)target).OriginId.Should().Be(source.Id); + target.ShouldNotBeNull(); + target.ShouldBeOfType(); + ((TargetDerivedLeaf)target).OriginId.ShouldBe(source.Id); } [Fact] @@ -59,10 +59,10 @@ public void CreateTarget_WithReverseRelation_CreateAndConvert() var target = testCandidate.Create(source, reverseRelation); testCandidate.Convert(source, target, processings); - target.Should().NotBeNull(); - target.Should().BeOfType(); - ((TargetDerivedLeaf)target).OriginId.Should().Be(source.Id); - target.TargetRoot.Should().Be(reverseRelation); + target.ShouldNotBeNull(); + target.ShouldBeOfType(); + ((TargetDerivedLeaf)target).OriginId.ShouldBe(source.Id); + target.TargetRoot.ShouldBe(reverseRelation); } } } diff --git a/src/BBT.StructureTools.Tests/Convert/CreateTargetConvertTarget/CreateTargetConvertTargetHelperFactoryTests.cs b/src/BBT.StructureTools.Tests/Convert/CreateTargetConvertTarget/CreateTargetConvertTargetHelperFactoryTests.cs index 0929748a..025414c3 100644 --- a/src/BBT.StructureTools.Tests/Convert/CreateTargetConvertTarget/CreateTargetConvertTargetHelperFactoryTests.cs +++ b/src/BBT.StructureTools.Tests/Convert/CreateTargetConvertTarget/CreateTargetConvertTargetHelperFactoryTests.cs @@ -5,7 +5,7 @@ using BBT.StructureTools.Tests.Convert.Registrations; using BBT.StructureTools.Tests.Convert.TestData; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -28,8 +28,8 @@ public void GetConvertHelper_NoReverseRelation_GetsExpectedTypes() var testCandidate = container.Get>(); var helper = testCandidate.GetConvertHelper(); - testCandidate.Should().BeOfType>(); - helper.Should().BeOfType>(); + testCandidate.ShouldBeOfType>(); + helper.ShouldBeOfType>(); } [Fact] @@ -42,8 +42,8 @@ public void GetConvertHelper_WithReverseRelation_GetsExpectedTypes() var testCandidate = container.Get>(); var helper = testCandidate.GetConvertHelper(x => x.TargetTree); - testCandidate.Should().BeOfType>(); - helper.Should().BeOfType>(); + testCandidate.ShouldBeOfType>(); + helper.ShouldBeOfType>(); } } } diff --git a/src/BBT.StructureTools.Tests/Convert/CreateTargetConvertTarget/CreateTargetConvertTargetHelperTests.cs b/src/BBT.StructureTools.Tests/Convert/CreateTargetConvertTarget/CreateTargetConvertTargetHelperTests.cs index 7ae57416..e7a3fb65 100644 --- a/src/BBT.StructureTools.Tests/Convert/CreateTargetConvertTarget/CreateTargetConvertTargetHelperTests.cs +++ b/src/BBT.StructureTools.Tests/Convert/CreateTargetConvertTarget/CreateTargetConvertTargetHelperTests.cs @@ -7,7 +7,7 @@ using BBT.StructureTools.Tests.Convert.Registrations; using BBT.StructureTools.Tests.Convert.TestData; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -33,8 +33,8 @@ public void CreateTarget_NoReverseRelation_CreateAndConvert() var target = testCandidate.Create(source); testCandidate.Convert(source, target, processings); - target.Should().NotBeNull(); - target.OriginId.Should().Be(source.Id); + target.ShouldNotBeNull(); + target.OriginId.ShouldBe(source.Id); } [Fact] @@ -52,9 +52,9 @@ public void CreateTarget_WithReverseRelation_CreateAndConvert() var target = testCandidate.Create(source, reverseRelation); testCandidate.Convert(source, target, processings); - target.Should().NotBeNull(); - target.OriginId.Should().Be(source.Id); - target.TargetTree.Should().Be(reverseRelation); + target.ShouldNotBeNull(); + target.OriginId.ShouldBe(source.Id); + target.TargetTree.ShouldBe(reverseRelation); } } } diff --git a/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTarget/CreateTargetImplConvertTargetHelperFactoryTests.cs b/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTarget/CreateTargetImplConvertTargetHelperFactoryTests.cs index a7bfd800..6b9d51bd 100644 --- a/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTarget/CreateTargetImplConvertTargetHelperFactoryTests.cs +++ b/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTarget/CreateTargetImplConvertTargetHelperFactoryTests.cs @@ -5,7 +5,7 @@ using BBT.StructureTools.Tests.Convert.Registrations; using BBT.StructureTools.Tests.Convert.TestData; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -28,8 +28,8 @@ public void GetConvertHelper_NoReverseRelation_GetsExpectedTypes() var testCandidate = container.Get>(); var helper = testCandidate.GetConvertHelper(); - testCandidate.Should().BeOfType>(); - helper.Should().BeOfType>(); + testCandidate.ShouldBeOfType>(); + helper.ShouldBeOfType>(); } [Fact] @@ -42,8 +42,8 @@ public void GetConvertHelper_WithReverseRelation_GetsExpectedTypes() var testCandidate = container.Get>(); var helper = testCandidate.GetConvertHelper(x => x.TargetTree); - testCandidate.Should().BeOfType>(); - helper.Should().BeOfType>(); + testCandidate.ShouldBeOfType>(); + helper.ShouldBeOfType>(); } } } diff --git a/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTarget/CreateTargetImplConvertTargetHelperTests.cs b/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTarget/CreateTargetImplConvertTargetHelperTests.cs index 9449fd46..8f5e9d9d 100644 --- a/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTarget/CreateTargetImplConvertTargetHelperTests.cs +++ b/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTarget/CreateTargetImplConvertTargetHelperTests.cs @@ -7,7 +7,7 @@ using BBT.StructureTools.Tests.Convert.Registrations; using BBT.StructureTools.Tests.Convert.TestData; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -33,8 +33,8 @@ public void CreateTarget_NoReverseRelation_CreateAndConvert() var target = testCandidate.Create(source); testCandidate.Convert(source, target, processings); - target.Should().NotBeNull(); - target.OriginId.Should().Be(source.Id); + target.ShouldNotBeNull(); + target.OriginId.ShouldBe(source.Id); } [Fact] @@ -52,9 +52,9 @@ public void CreateTarget_WithReverseRelation_CreateAndConvert() var target = testCandidate.Create(source, reverseRelation); testCandidate.Convert(source, target, processings); - target.Should().NotBeNull(); - target.OriginId.Should().Be(source.Id); - target.TargetTree.Should().Be(reverseRelation); + target.ShouldNotBeNull(); + target.OriginId.ShouldBe(source.Id); + target.TargetTree.ShouldBe(reverseRelation); } } } diff --git a/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTargetImpl/CreateTargetImplConvertTargetImplHelperFactoryTests.cs b/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTargetImpl/CreateTargetImplConvertTargetImplHelperFactoryTests.cs index e6238bfe..997d6533 100644 --- a/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTargetImpl/CreateTargetImplConvertTargetImplHelperFactoryTests.cs +++ b/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTargetImpl/CreateTargetImplConvertTargetImplHelperFactoryTests.cs @@ -5,7 +5,7 @@ using BBT.StructureTools.Tests.Convert.Registrations; using BBT.StructureTools.Tests.Convert.TestData; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -28,8 +28,8 @@ public void GetConvertHelper_NoReverseRelation_GetsExpectedTypes() var testCandidate = container.Get>(); var helper = testCandidate.GetConvertHelper(); - testCandidate.Should().BeOfType>(); - helper.Should().BeOfType>(); + testCandidate.ShouldBeOfType>(); + helper.ShouldBeOfType>(); } [Fact] @@ -42,8 +42,8 @@ public void GetConvertHelper_WithReverseRelation_GetsExpectedTypes() var testCandidate = container.Get>(); var helper = testCandidate.GetConvertHelper(x => x.TargetTree); - testCandidate.Should().BeOfType>(); - helper.Should().BeOfType>(); + testCandidate.ShouldBeOfType>(); + helper.ShouldBeOfType>(); } } } diff --git a/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTargetImpl/CreateTargetImplConvertTargetImplHelperTests.cs b/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTargetImpl/CreateTargetImplConvertTargetImplHelperTests.cs index 3c5b945b..56d2f2fa 100644 --- a/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTargetImpl/CreateTargetImplConvertTargetImplHelperTests.cs +++ b/src/BBT.StructureTools.Tests/Convert/CreateTargetImplConvertTargetImpl/CreateTargetImplConvertTargetImplHelperTests.cs @@ -7,7 +7,7 @@ using BBT.StructureTools.Tests.Convert.Registrations; using BBT.StructureTools.Tests.Convert.TestData; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -33,8 +33,8 @@ public void CreateTarget_NoReverseRelation_CreateAndConvert() var target = testCandidate.Create(source); testCandidate.Convert(source, target, processings); - target.Should().NotBeNull(); - target.OriginId.Should().Be(source.Id); + target.ShouldNotBeNull(); + target.OriginId.ShouldBe(source.Id); } [Fact] @@ -52,9 +52,9 @@ public void CreateTarget_WithReverseRelation_CreateAndConvert() var target = testCandidate.Create(source, reverseRelation); testCandidate.Convert(source, target, processings); - target.Should().NotBeNull(); - target.OriginId.Should().Be(source.Id); - target.TargetTree.Should().Be(reverseRelation); + target.ShouldNotBeNull(); + target.OriginId.ShouldBe(source.Id); + target.TargetTree.ShouldBe(reverseRelation); } } } diff --git a/src/BBT.StructureTools.Tests/Copy/CopierIntegrationTests.cs b/src/BBT.StructureTools.Tests/Copy/CopierIntegrationTests.cs index a6c0477a..4833124b 100644 --- a/src/BBT.StructureTools.Tests/Copy/CopierIntegrationTests.cs +++ b/src/BBT.StructureTools.Tests/Copy/CopierIntegrationTests.cs @@ -7,13 +7,12 @@ using BBT.StructureTools.Copy.Helper; using BBT.StructureTools.Copy.Processing; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; public class CopierIntegrationTests { - #region members and setup private readonly ICopy testCandidate; public CopierIntegrationTests() @@ -27,7 +26,6 @@ public CopierIntegrationTests() this.testCandidate = kernel.Get>(); } - #endregion /// /// Tests ICopy.Copy. @@ -65,9 +63,9 @@ public void Copy_MustNotCopyChildrenWhenIntercepted() // Assert // Make sure original and copy of the parent object are not the same. - testClassParentCopy.Should().NotBeSameAs(testClassParentOriginal); + testClassParentCopy.ShouldNotBeSameAs(testClassParentOriginal); - testClassParentCopyChildren.Count.Should().Be(0); + testClassParentCopyChildren.Count.ShouldBe(0); } /// @@ -106,13 +104,13 @@ public void Copy_MustCopyInheritedChildrenWhenIntercepted() // Assert // Make sure original and copy of the parent object are not the same. - testClassParentCopy.Should().NotBeSameAs(testClassParentOriginal); + testClassParentCopy.ShouldNotBeSameAs(testClassParentOriginal); - testClassParentOriginal.Children.Count.Should().Be(3); + testClassParentOriginal.Children.Count.ShouldBe(3); foreach (var childhild in testClassParentCopyChildren) { - childhild.ParentReference.Should().BeSameAs(testClassParentCopy); + childhild.ParentReference.ShouldBeSameAs(testClassParentCopy); } } @@ -152,17 +150,16 @@ public void Copy_MustNotCopyInheritedChildrenAndChildrenWhenChildrenIntercepted( // Assert // Make sure original and copy of the parent object are not the same. - testClassParentCopy.Should().NotBeSameAs(testClassParentOriginal); + testClassParentCopy.ShouldNotBeSameAs(testClassParentOriginal); - testClassParentCopyChildren.Count.Should().Be(0); + testClassParentCopyChildren.Count.ShouldBe(0); foreach (var childhild in testClassParentCopyChildren) { - childhild.ParentReference.Should().BeSameAs(testClassParentCopy); + childhild.ParentReference.ShouldBeSameAs(testClassParentCopy); } } - #region test data /// /// An interface, defining a test class to be used as child in the tests above. @@ -254,7 +251,7 @@ private class ChildTestClassCopyRegistrations : ICopyRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); } } @@ -262,7 +259,7 @@ private class ChildTestClass2CopyRegistrations : ICopyRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterSubCopy>(); } @@ -272,7 +269,7 @@ private class TestClassCopyRegistrations : ICopyRegistrations { public void DoRegistrations(ICopyHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterCreateToManyWithReverseRelation( x => x.Children?.Cast(), @@ -280,6 +277,5 @@ public void DoRegistrations(ICopyHelperRegistration registrati x => x.ParentReference); } } - #endregion } } \ No newline at end of file diff --git a/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToManyFromGenericStrategyIntTests.cs b/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToManyFromGenericStrategyIntTests.cs index 85f1fe75..32c4858c 100644 --- a/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToManyFromGenericStrategyIntTests.cs +++ b/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToManyFromGenericStrategyIntTests.cs @@ -8,14 +8,12 @@ using BBT.StructureTools.Copy.Helper; using BBT.StructureTools.Copy.Strategy; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; public class CopyOperationCreateToManyFromGenericStrategyIntTests { - #region setup - private readonly ICopy testCandidate; public CopyOperationCreateToManyFromGenericStrategyIntTests() @@ -30,7 +28,6 @@ public CopyOperationCreateToManyFromGenericStrategyIntTests() this.testCandidate = kernel.Get>(); } - #endregion /// /// Tests whether the strategy is actually being used during copy. @@ -57,19 +54,19 @@ public void MustUseStrategyWhenCopying() // Assert // Make sure original and copy of the parent object are not the same. - testClassParentCopy.Should().NotBeSameAs(testClassParentOriginal); + testClassParentCopy.ShouldNotBeSameAs(testClassParentOriginal); - testClassParentCopyChildren.Count.Should().Be(3); + testClassParentCopyChildren.Count.ShouldBe(3); - testClassParentCopyChildren.ElementAt(0).TestValue.Should().Be(testClassParentOriginchildren.ElementAt(0).TestValue * 2); - testClassParentCopyChildren.ElementAt(1).TestValue.Should().Be(testClassParentOriginchildren.ElementAt(1).TestValue * 2); - testClassParentCopyChildren.ElementAt(2).TestValue.Should().Be(testClassParentOriginchildren.ElementAt(2).TestValue * 2); + testClassParentCopyChildren.ElementAt(0).TestValue.ShouldBe(testClassParentOriginchildren.ElementAt(0).TestValue * 2); + testClassParentCopyChildren.ElementAt(1).TestValue.ShouldBe(testClassParentOriginchildren.ElementAt(1).TestValue * 2); + testClassParentCopyChildren.ElementAt(2).TestValue.ShouldBe(testClassParentOriginchildren.ElementAt(2).TestValue * 2); foreach (var copiedChild in testClassParentCopyChildren) { foreach (var originchild in testClassParentOriginal.Children) { - originchild.Should().NotBeSameAs(copiedChild); + originchild.ShouldNotBeSameAs(copiedChild); } } } @@ -114,12 +111,11 @@ public void Copy_MustCopyEmptyCollection() // Assert // Make sure original and copy of the parent object are not the same. // Also make sure the parent test class children collection, which is empty, was copied. - testClassParentCopy.Should().NotBeSameAs(testClassParentOriginal); - testClassParentCopy.Children.Should().NotBeSameAs(testClassParentOriginal.Children); - testClassParentCopy.Children.Should().NotBeNull(); + testClassParentCopy.ShouldNotBeSameAs(testClassParentOriginal); + testClassParentCopy.Children.ShouldNotBeSameAs(testClassParentOriginal.Children); + testClassParentCopy.Children.ShouldNotBeNull(); } - #region test data /// /// An interface, defining a test class to be used as child in the tests above. @@ -202,7 +198,7 @@ private class ChildTestClassCopyRegistrations : ICopyRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); } } @@ -210,7 +206,7 @@ private class TestClassCopyRegistrations : ICopyRegistrations { public void DoRegistrations(ICopyHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterCreateToManyFromGenericStrategy( x => x.Children.Cast(), x => x.Children, @@ -246,9 +242,9 @@ public IChildTestClass Create() public void Copy(IChildTestClass source, IChildTestClass target, ICopyCallContext copyCalcontext) { - source.Should().NotBeNull(); - target.Should().NotBeNull(); - copyCalcontext.Should().NotBeNull(); + source.ShouldNotBeNull(); + target.ShouldNotBeNull(); + copyCalcontext.ShouldNotBeNull(); target.TestValue = source.TestValue * 2; } @@ -261,6 +257,5 @@ public TestStrategy GetStrategy(IChildTestClass criterion) return new TestStrategy(); } } - #endregion } } \ No newline at end of file diff --git a/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToManyFromGenericStrategyWithReverseRelationIntTests.cs b/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToManyFromGenericStrategyWithReverseRelationIntTests.cs index 84dd64c6..dc0ebdd0 100644 --- a/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToManyFromGenericStrategyWithReverseRelationIntTests.cs +++ b/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToManyFromGenericStrategyWithReverseRelationIntTests.cs @@ -8,14 +8,12 @@ using BBT.StructureTools.Copy.Helper; using BBT.StructureTools.Copy.Strategy; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; public class CopyOperationCreateToManyFromGenericStrategyWithReverseRelationIntTests { - #region setup - private readonly ICopy testCandidate; public CopyOperationCreateToManyFromGenericStrategyWithReverseRelationIntTests() @@ -30,7 +28,6 @@ public CopyOperationCreateToManyFromGenericStrategyWithReverseRelationIntTests() this.testCandidate = kernel.Get>(); } - #endregion /// /// Tests whether the strategy is actually being used during copy. @@ -57,26 +54,26 @@ public void MustUseStrategyWhenCopying() // Assert // Make sure original and copy of the parent object are not the same. - testClassParentCopy.Should().NotBeSameAs(testClassParentOriginal); + testClassParentCopy.ShouldNotBeSameAs(testClassParentOriginal); - testClassParentCopyChildren.Count.Should().Be(3); + testClassParentCopyChildren.Count.ShouldBe(3); - testClassParentCopyChildren.ElementAt(0).TestValue.Should().Be(testClassParentOriginchildren.ElementAt(0).TestValue * 2); - testClassParentCopyChildren.ElementAt(1).TestValue.Should().Be(testClassParentOriginchildren.ElementAt(1).TestValue * 2); - testClassParentCopyChildren.ElementAt(2).TestValue.Should().Be(testClassParentOriginchildren.ElementAt(2).TestValue * 2); + testClassParentCopyChildren.ElementAt(0).TestValue.ShouldBe(testClassParentOriginchildren.ElementAt(0).TestValue * 2); + testClassParentCopyChildren.ElementAt(1).TestValue.ShouldBe(testClassParentOriginchildren.ElementAt(1).TestValue * 2); + testClassParentCopyChildren.ElementAt(2).TestValue.ShouldBe(testClassParentOriginchildren.ElementAt(2).TestValue * 2); foreach (var copiedChild in testClassParentCopyChildren) { foreach (var originalChild in testClassParentOriginal.Children) { - originalChild.Should().NotBeSameAs(copiedChild); + originalChild.ShouldNotBeSameAs(copiedChild); } } // Check for the correct referential reverse relation copy. foreach (var child in testClassParentCopyChildren) { - child.Parent.Should().BeSameAs(testClassParentCopy); + child.Parent.ShouldBeSameAs(testClassParentCopy); } } @@ -120,12 +117,11 @@ public void Copy_MustCopyEmptyCollection() // Assert // Make sure original and copy of the parent object are not the same. // Also make sure the parent test class children collection, which is empty, was copied. - testClassParentCopy.Should().NotBeSameAs(testClassParentOriginal); - testClassParentCopy.Children.Should().NotBeSameAs(testClassParentOriginal.Children); - testClassParentCopy.Should().NotBeNull(); + testClassParentCopy.ShouldNotBeSameAs(testClassParentOriginal); + testClassParentCopy.Children.ShouldNotBeSameAs(testClassParentOriginal.Children); + testClassParentCopy.ShouldNotBeNull(); } - #region test data /// /// An interface, defining a test class to be used as child in the tests above. @@ -214,7 +210,7 @@ private class ChildTestClassCopyRegistrations : ICopyRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); } } @@ -222,7 +218,7 @@ private class TestClassCopyRegistrations : ICopyRegistrations { public void DoRegistrations(ICopyHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterCreateToManyFromGenericStrategyWithReverseRelation( x => x.Children.Cast(), @@ -248,9 +244,9 @@ public bool IsResponsible(IChildTestClass criterion) public void Copy(IChildTestClass source, IChildTestClass target, ICopyCallContext copyCallContext) { - source.Should().NotBeNull(); - target.Should().NotBeNull(); - copyCallContext.Should().NotBeNull(); + source.ShouldNotBeNull(); + target.ShouldNotBeNull(); + copyCallContext.ShouldNotBeNull(); target.TestValue = source.TestValue * 2; } @@ -268,6 +264,5 @@ public TestStrategy GetStrategy(IChildTestClass criterion) return new TestStrategy(); } } - #endregion } } \ No newline at end of file diff --git a/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToManyWithReverseRelationIntTests.cs b/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToManyWithReverseRelationIntTests.cs index 04095624..c650d314 100644 --- a/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToManyWithReverseRelationIntTests.cs +++ b/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToManyWithReverseRelationIntTests.cs @@ -6,13 +6,12 @@ using BBT.StructureTools.Copy; using BBT.StructureTools.Copy.Helper; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; public class CopyOperationCreateToManyWithReverseRelationIntTests { - #region members and setup private readonly ICopy testCandidate; public CopyOperationCreateToManyWithReverseRelationIntTests() @@ -25,7 +24,6 @@ public CopyOperationCreateToManyWithReverseRelationIntTests() this.testCandidate = kernel.Get>(); } - #endregion /// /// Tests ICopy.Copy. @@ -60,15 +58,15 @@ public void Copy_MustCopyParentReference() // Assert // Make sure original and copy of the parent object are not the same. - testClassParentCopy.Should().NotBeSameAs(testClassParentOriginal); + testClassParentCopy.ShouldNotBeSameAs(testClassParentOriginal); // Don't forget to do this! Since the Children are a Collection the above wy of // retrieving the ist is not typesafe and some objects could fall between chairs and table. - testClassParentCopyChildren.Count.Should().Be(3); + testClassParentCopyChildren.Count.ShouldBe(3); foreach (var child in testClassParentCopyChildren) { - child.ParentReference.Should().BeSameAs(testClassParentCopy); + child.ParentReference.ShouldBeSameAs(testClassParentCopy); } } @@ -115,12 +113,11 @@ public void Copy_MustCopyEmptyCollection() // Assert // Make sure original and copy of the parent object are not the same. // Also make sure the parent test class children collection, which is empty, was copied. - testClassParentCopy.Should().NotBeSameAs(testClassParentOriginal); - testClassParentCopy.Children.Should().NotBeSameAs(testClassParentOriginal.Children); - testClassParentCopy.Children.Should().NotBeNull(); + testClassParentCopy.ShouldNotBeSameAs(testClassParentOriginal); + testClassParentCopy.Children.ShouldNotBeSameAs(testClassParentOriginal.Children); + testClassParentCopy.Children.ShouldNotBeNull(); } - #region test data /// /// An interface, defining a test class to be used as child in the tests above. @@ -202,7 +199,7 @@ private class ChildTestClassCopyRegistrations : ICopyRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); } } @@ -210,7 +207,7 @@ private class TestClassCopyRegistrations : ICopyRegistrations { public void DoRegistrations(ICopyHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterCreateToManyWithReverseRelation( x => x.Children?.Cast(), @@ -218,6 +215,5 @@ public void DoRegistrations(ICopyHelperRegistration registrati x => x.ParentReference); } } - #endregion } } \ No newline at end of file diff --git a/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToOneWithReverseRelationIntTests.cs b/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToOneWithReverseRelationIntTests.cs index b84f8dd0..f1609231 100644 --- a/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToOneWithReverseRelationIntTests.cs +++ b/src/BBT.StructureTools.Tests/Copy/CopyOperationCreateToOneWithReverseRelationIntTests.cs @@ -5,13 +5,12 @@ using BBT.StructureTools.Copy; using BBT.StructureTools.Copy.Helper; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; public class CopyOperationCreateToOneWithReverseRelationIntTests { - #region members and setup private readonly ICopy testCandidate; public CopyOperationCreateToOneWithReverseRelationIntTests() @@ -24,7 +23,6 @@ public CopyOperationCreateToOneWithReverseRelationIntTests() this.testCandidate = kernel.Get>(); } - #endregion /// /// Tests ICopy.Copy. @@ -49,10 +47,10 @@ public void Copy_MustCopyParentReference() // Assert // Make sure original and copy of the parent object are not the same. - testClassParentCopy.Should().NotBeSameAs(testClassParentOriginal); + testClassParentCopy.ShouldNotBeSameAs(testClassParentOriginal); // Check if the Child's new reference is correctly set to the copied parent's reference. - testClassParentCopy.Should().BeSameAs(testClassParentCopy.Child.ParentReference); + testClassParentCopy.ShouldBeSameAs(testClassParentCopy.Child.ParentReference); } /// @@ -78,13 +76,12 @@ public void Copy_MustNotFailWhenChildIsNull() // Assert // Make sure original and copy of the parent object are not the same. - testClassParentCopy.Should().NotBeSameAs(testClassParentOriginal); + testClassParentCopy.ShouldNotBeSameAs(testClassParentOriginal); // Check if the Child of the copied class is null - testClassParentCopy.Child.Should().BeNull(); + testClassParentCopy.Child.ShouldBeNull(); } - #region test data /// /// An interface, defining a test class to be used as child in the tests above. @@ -131,7 +128,7 @@ private class ChildTestClassCopyRegistrations : ICopyRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); } } @@ -139,13 +136,12 @@ private class TestClassCopyRegistrations : ICopyRegistrations { public void DoRegistrations(ICopyHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterCreateToOneWithReverseRelation( x => x.Child, x => x.ParentReference); } } - #endregion } } \ No newline at end of file diff --git a/src/BBT.StructureTools.Tests/Copy/CopyOperationCrossReferenceProcessingIntTests.cs b/src/BBT.StructureTools.Tests/Copy/CopyOperationCrossReferenceProcessingIntTests.cs index 663f2afe..d31f419d 100644 --- a/src/BBT.StructureTools.Tests/Copy/CopyOperationCrossReferenceProcessingIntTests.cs +++ b/src/BBT.StructureTools.Tests/Copy/CopyOperationCrossReferenceProcessingIntTests.cs @@ -4,7 +4,7 @@ using BBT.StructureTools.Copy; using BBT.StructureTools.Copy.Helper; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -45,8 +45,8 @@ public void MustExecuteAndSetCrossReferenceRegistrations() this.testCandidate.Copy(source, target, new List()); // Assert - crossReferenceSource.Should().NotBeSameAs(target.TestClassCrossReferencedChild); - target.TestClassCrossReferencedChild.Should().BeSameAs(target.TestClassChild.CrossReference); + crossReferenceSource.ShouldNotBeSameAs(target.TestClassCrossReferencedChild); + target.TestClassCrossReferencedChild.ShouldBeSameAs(target.TestClassChild.CrossReference); } private class TestClass @@ -72,7 +72,7 @@ private class TestClassCopyRegistrations : ICopyRegistrations { public void DoRegistrations(ICopyHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations .RegisterCrossReferenceProcessing( @@ -90,7 +90,7 @@ private class TestClassCrossReferencedChildCopyRegistrations : ICopyRegistration { public void DoRegistrations(ICopyHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); } } @@ -98,7 +98,7 @@ private class TestClassChildCopyRegistrations : ICopyRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); } } } diff --git a/src/BBT.StructureTools.Tests/Copy/CopyOperationInlineValueProcessingTests.cs b/src/BBT.StructureTools.Tests/Copy/CopyOperationInlineValueProcessingTests.cs index fa8ab640..5db78a36 100644 --- a/src/BBT.StructureTools.Tests/Copy/CopyOperationInlineValueProcessingTests.cs +++ b/src/BBT.StructureTools.Tests/Copy/CopyOperationInlineValueProcessingTests.cs @@ -5,7 +5,7 @@ using BBT.StructureTools.Copy; using BBT.StructureTools.Copy.Helper; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -36,7 +36,7 @@ public void MustExecuteInlineCopyProcessing() this.testCandidate.Copy(source, target, new List()); // Assert - target.TestGuid.Should().NotBe(Guid.Empty); + target.TestGuid.ShouldNotBe(Guid.Empty); } private class TestClass @@ -48,7 +48,7 @@ private class TestClassCopyRegistrations : ICopyRegistrations { public void DoRegistrations(ICopyHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations .RegisterInlineValueProcessing(x => x.TestGuid, () => Guid.NewGuid()); diff --git a/src/BBT.StructureTools.Tests/Copy/CopyOperationIntTests.cs b/src/BBT.StructureTools.Tests/Copy/CopyOperationIntTests.cs index d73953d2..71c0fdaa 100644 --- a/src/BBT.StructureTools.Tests/Copy/CopyOperationIntTests.cs +++ b/src/BBT.StructureTools.Tests/Copy/CopyOperationIntTests.cs @@ -5,7 +5,7 @@ using BBT.StructureTools.Copy.Helper; using BBT.StructureTools.Copy.Processing; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -36,7 +36,7 @@ public void Copy_WhenAttributeRegistered_MustCopyAttribute() this.testCandidate.Copy(source, target, new List()); // Assert - target.Value1.Should().Be(42); + target.Value1.ShouldBe(42); } /// @@ -53,7 +53,7 @@ public void Copy_WhenAttributeNotRegistered_MustNotCopyAttribute() this.testCandidate.Copy(source, target, new List()); // Assert - target.Value2.Should().Be(35); + target.Value2.ShouldBe(35); } /// @@ -75,8 +75,8 @@ public void Copy_MustExecuteAdditionalProcessings() this.testCandidate.Copy(source, target, additionalProcessings); // Assert - target.Value1.Should().Be(27); - target.Value2.Should().Be(39); + target.Value1.ShouldBe(27); + target.Value2.ShouldBe(39); } private class TestClass @@ -90,7 +90,7 @@ private class TestClassCopyRegistrations : ICopyRegistrations { public void DoRegistrations(ICopyHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations .RegisterAttribute(x => x.Value1); diff --git a/src/BBT.StructureTools.Tests/Copy/CopyOperationPostProcessing/CopyOperationPostProcessingUsingParamsIntTests.cs b/src/BBT.StructureTools.Tests/Copy/CopyOperationPostProcessing/CopyOperationPostProcessingUsingParamsIntTests.cs index 0142fc4a..646ac96a 100644 --- a/src/BBT.StructureTools.Tests/Copy/CopyOperationPostProcessing/CopyOperationPostProcessingUsingParamsIntTests.cs +++ b/src/BBT.StructureTools.Tests/Copy/CopyOperationPostProcessing/CopyOperationPostProcessingUsingParamsIntTests.cs @@ -11,7 +11,7 @@ namespace BBT.Life.LiBase.ITests.General.Services.Tools.Copy.CopyOperationPostPr using BBT.StructureTools.Copy.Processing; using BBT.StructureTools.Extension; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -20,8 +20,6 @@ namespace BBT.Life.LiBase.ITests.General.Services.Tools.Copy.CopyOperationPostPr /// public class CopyOperationPostProcessingUsingParamsIntTests { - #region setup and members - private ICopy copy; public CopyOperationPostProcessingUsingParamsIntTests() @@ -32,9 +30,7 @@ public CopyOperationPostProcessingUsingParamsIntTests() this.copy = container.Get>(); } - #endregion - #region Tests /// /// Tests for the execution of a single post processing which was registered via @@ -51,13 +47,11 @@ public void MustExecuteRegisteredPostProcessingsWhenParamsAreUsed() this.copy.Copy(testClassOriginal, testClassCopy, new List()); // Assert - testClassCopy.TestValue.Should().Be(234); - testClassCopy.TestValue2.Should().Be(4321); + testClassCopy.TestValue.ShouldBe(234); + testClassCopy.TestValue2.ShouldBe(4321); } - #endregion - #region Testdata /// /// Interface for a test class. @@ -101,6 +95,5 @@ public void DoRegistrations(ICopyHelperRegistration registrations) new GenericCopyPostProcessing((source, target) => target.TestValue2 = 4321)); } } - #endregion } } \ No newline at end of file diff --git a/src/BBT.StructureTools.Tests/Copy/CopyOperationPostProcessing/CopyOperationPostProcessingWithoutUsingParamsIntTest.cs b/src/BBT.StructureTools.Tests/Copy/CopyOperationPostProcessing/CopyOperationPostProcessingWithoutUsingParamsIntTest.cs index 94a0451b..1c545af3 100644 --- a/src/BBT.StructureTools.Tests/Copy/CopyOperationPostProcessing/CopyOperationPostProcessingWithoutUsingParamsIntTest.cs +++ b/src/BBT.StructureTools.Tests/Copy/CopyOperationPostProcessing/CopyOperationPostProcessingWithoutUsingParamsIntTest.cs @@ -10,7 +10,7 @@ namespace BBT.StructureTools.Tests.Copy.CopyOperationPostProcessing using BBT.StructureTools.Copy.Processing; using BBT.StructureTools.Extension; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -19,8 +19,6 @@ namespace BBT.StructureTools.Tests.Copy.CopyOperationPostProcessing /// public class CopyOperationPostProcessingWithoutUsingParamsIntTest { - #region setup and members - private ICopy copy; public CopyOperationPostProcessingWithoutUsingParamsIntTest() @@ -31,9 +29,7 @@ public CopyOperationPostProcessingWithoutUsingParamsIntTest() this.copy = container.Get>(); } - #endregion - #region Tests /// /// Tests for the execution of a single post processing which was registered via @@ -50,13 +46,11 @@ public void MustExecuteRegisteredSinglePostProcessings() this.copy.Copy(testClassOriginal, testClassCopy, new List()); // Assert - testClassCopy.TestValue.Should().Be(234); - testClassCopy.TestValue2.Should().Be(0); + testClassCopy.TestValue.ShouldBe(234); + testClassCopy.TestValue2.ShouldBe(0); } - #endregion - #region Testdata /// /// Interface for a test class. @@ -99,6 +93,5 @@ public void DoRegistrations(ICopyHelperRegistration registrations) new GenericCopyPostProcessing((source, target) => target.TestValue = 234)); } } - #endregion } } \ No newline at end of file diff --git a/src/BBT.StructureTools.Tests/Copy/CopyOperationRegisterCreateFromFactoryTests.cs b/src/BBT.StructureTools.Tests/Copy/CopyOperationRegisterCreateFromFactoryTests.cs index 322625cc..63736050 100644 --- a/src/BBT.StructureTools.Tests/Copy/CopyOperationRegisterCreateFromFactoryTests.cs +++ b/src/BBT.StructureTools.Tests/Copy/CopyOperationRegisterCreateFromFactoryTests.cs @@ -4,7 +4,7 @@ using BBT.StructureTools.Copy; using BBT.StructureTools.Copy.Helper; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -36,8 +36,8 @@ public void MustExecuteInlineCopyProcessing() this.testCandidate.Copy(source, target, new List()); // Assert - target.Value1.Should().Be(888); - target.Value2.Should().Be(999); + target.Value1.ShouldBe(888); + target.Value2.ShouldBe(999); } /// @@ -78,7 +78,7 @@ private class TestClassCopyRegistrations : ICopyRegistrations { public void DoRegistrations(ICopyHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations .RegisterCreateFromFactory(x => x.Value1, x => x.GetValue1()) diff --git a/src/BBT.StructureTools.Tests/Copy/CopyOperationSubCopyIntTests.cs b/src/BBT.StructureTools.Tests/Copy/CopyOperationSubCopyIntTests.cs index 6e53beaf..0c069660 100644 --- a/src/BBT.StructureTools.Tests/Copy/CopyOperationSubCopyIntTests.cs +++ b/src/BBT.StructureTools.Tests/Copy/CopyOperationSubCopyIntTests.cs @@ -5,7 +5,7 @@ using BBT.StructureTools.Copy.Helper; using BBT.StructureTools.Copy.Processing; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; @@ -37,7 +37,7 @@ public void Copy_WhenAttributeRegistered_MustCopyAttribute() this.testCandidate.Copy(source, target, new List()); // Assert - target.Value1.Should().Be(45); + target.Value1.ShouldBe(45); } /// @@ -54,7 +54,7 @@ public void Copy_WhenAttributeNotRegistered_MustNotCopyAttribute() this.testCandidate.Copy(source, target, new List()); // Assert - target.Value2.Should().Be(35); + target.Value2.ShouldBe(35); } /// @@ -76,8 +76,8 @@ public void Copy_MustExecuteAdditionalProcessings() this.testCandidate.Copy(source, target, additionalProcessings); // Assert - target.Value1.Should().Be(27); - target.Value2.Should().Be(39); + target.Value1.ShouldBe(27); + target.Value2.ShouldBe(39); } private class TestClassChild : TestClassParent @@ -95,7 +95,7 @@ private class TestClassChildCopyRegistrations : ICopyRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations .RegisterSubCopy>(); @@ -106,7 +106,7 @@ private class TestClassParentCopyRegistrations : ICopyRegistrations registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations .RegisterAttribute(x => x.Value1); diff --git a/src/BBT.StructureTools.Tests/Copy/PostProcessing/CopyOperationPostProcessingUsingParamsIntTests.cs b/src/BBT.StructureTools.Tests/Copy/PostProcessing/CopyOperationPostProcessingUsingParamsIntTests.cs index 14acc5e2..420b355d 100644 --- a/src/BBT.StructureTools.Tests/Copy/PostProcessing/CopyOperationPostProcessingUsingParamsIntTests.cs +++ b/src/BBT.StructureTools.Tests/Copy/PostProcessing/CopyOperationPostProcessingUsingParamsIntTests.cs @@ -5,14 +5,12 @@ using BBT.StructureTools.Copy.Helper; using BBT.StructureTools.Copy.Processing; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; public sealed class CopyOperationPostProcessingUsingParamsIntTests { - #region setup and members - private readonly ICopy testCandidate; public CopyOperationPostProcessingUsingParamsIntTests() @@ -24,9 +22,7 @@ public CopyOperationPostProcessingUsingParamsIntTests() this.testCandidate = kernel.Get>(); } - #endregion - #region Tests /// /// Tests for the execution of a single post processing which was registered via @@ -43,13 +39,11 @@ public void MustExecuteRegisteredPostProcessingsWhenParamsAreUsed() this.testCandidate.Copy(testClassOriginal, testClassCopy, new List()); // Assert - testClassCopy.TestValue.Should().Be(234); - testClassCopy.TestValue2.Should().Be(4321); + testClassCopy.TestValue.ShouldBe(234); + testClassCopy.TestValue2.ShouldBe(4321); } - #endregion - #region Testdata /// /// Interface for a test class. @@ -87,13 +81,12 @@ private class TestClassCopyRegistrations : ICopyRegistrations { public void DoRegistrations(ICopyHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterPostProcessings( new GenericCopyPostProcessing((source, target) => target.TestValue = 234), new GenericCopyPostProcessing((source, target) => target.TestValue2 = 4321)); } } - #endregion } } diff --git a/src/BBT.StructureTools.Tests/Copy/PostProcessing/CopyOperationPostProcessingWithoutUsingParamsIntTest.cs b/src/BBT.StructureTools.Tests/Copy/PostProcessing/CopyOperationPostProcessingWithoutUsingParamsIntTest.cs index 99c414c9..88fa7170 100644 --- a/src/BBT.StructureTools.Tests/Copy/PostProcessing/CopyOperationPostProcessingWithoutUsingParamsIntTest.cs +++ b/src/BBT.StructureTools.Tests/Copy/PostProcessing/CopyOperationPostProcessingWithoutUsingParamsIntTest.cs @@ -5,14 +5,12 @@ using BBT.StructureTools.Copy.Helper; using BBT.StructureTools.Copy.Processing; using BBT.StructureTools.Tests.TestTools; - using FluentAssertions; + using Shouldly; using Ninject; using Xunit; public class CopyOperationPostProcessingWithoutUsingParamsIntTest { - #region setup and members - private readonly ICopy testCandidate; public CopyOperationPostProcessingWithoutUsingParamsIntTest() @@ -24,9 +22,7 @@ public CopyOperationPostProcessingWithoutUsingParamsIntTest() this.testCandidate = kernel.Get>(); } - #endregion - #region Tests /// /// Tests for the execution of a single post processing which was registered via @@ -43,13 +39,11 @@ public void MustExecuteRegisteredSinglePostProcessings() this.testCandidate.Copy(testClassOriginal, testClassCopy, new List()); // Assert - testClassCopy.TestValue.Should().Be(234); - testClassCopy.TestValue2.Should().Be(0); + testClassCopy.TestValue.ShouldBe(234); + testClassCopy.TestValue2.ShouldBe(0); } - #endregion - #region Testdata /// /// Interface for a test class. @@ -87,11 +81,10 @@ private class TestClassCopyRegistrations : ICopyRegistrations { public void DoRegistrations(ICopyHelperRegistration registrations) { - registrations.Should().NotBeNull(); + registrations.ShouldNotBeNull(); registrations.RegisterPostProcessings( new GenericCopyPostProcessing((source, target) => target.TestValue = 234)); } } - #endregion } } diff --git a/src/BBT.StructureTools.Tests/TestTools/IoC/NinjectResolver.cs b/src/BBT.StructureTools.Tests/TestTools/IoC/NinjectResolver.cs index 3ac06c8f..cd5a7fcf 100644 --- a/src/BBT.StructureTools.Tests/TestTools/IoC/NinjectResolver.cs +++ b/src/BBT.StructureTools.Tests/TestTools/IoC/NinjectResolver.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; using BBT.StructureTools.Initialization; - using FluentAssertions; + using Shouldly; using Ninject; /// @@ -16,7 +16,7 @@ public class NinjectResolver : IIocResolver public NinjectResolver(IKernel kernel) { - kernel.Should().NotBeNull(); + kernel.ShouldNotBeNull(); this.kernel = kernel; } diff --git a/src/BBT.StructureTools.ruleset b/src/BBT.StructureTools.ruleset deleted file mode 100644 index a6345dcc..00000000 --- a/src/BBT.StructureTools.ruleset +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/BBT.StructureTools.sln b/src/BBT.StructureTools.sln deleted file mode 100644 index 7e4e894a..00000000 --- a/src/BBT.StructureTools.sln +++ /dev/null @@ -1,37 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.271 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BBT.StructureTools", "BBT.StructureTools\BBT.StructureTools.csproj", "{2F38B821-95F8-4560-B08E-9796C44D0C86}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BBT.StructureTools.Tests", "BBT.StructureTools.Tests\BBT.StructureTools.Tests.csproj", "{86D8402D-88CF-4887-A9BC-5662FC23BAFE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BBT.StructureTools.Extensions", "BBT.StructureTools.Extensions\BBT.StructureTools.Extensions.csproj", "{B7AFDD9C-B419-4B7F-B2BA-54A2AE197321}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2F38B821-95F8-4560-B08E-9796C44D0C86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2F38B821-95F8-4560-B08E-9796C44D0C86}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2F38B821-95F8-4560-B08E-9796C44D0C86}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2F38B821-95F8-4560-B08E-9796C44D0C86}.Release|Any CPU.Build.0 = Release|Any CPU - {86D8402D-88CF-4887-A9BC-5662FC23BAFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {86D8402D-88CF-4887-A9BC-5662FC23BAFE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {86D8402D-88CF-4887-A9BC-5662FC23BAFE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {86D8402D-88CF-4887-A9BC-5662FC23BAFE}.Release|Any CPU.Build.0 = Release|Any CPU - {B7AFDD9C-B419-4B7F-B2BA-54A2AE197321}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B7AFDD9C-B419-4B7F-B2BA-54A2AE197321}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B7AFDD9C-B419-4B7F-B2BA-54A2AE197321}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B7AFDD9C-B419-4B7F-B2BA-54A2AE197321}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {9E9EFC94-8A6D-473C-BA4C-2C793E565BA6} - EndGlobalSection -EndGlobal diff --git a/src/BBT.StructureTools.slnx b/src/BBT.StructureTools.slnx new file mode 100644 index 00000000..a67b8854 --- /dev/null +++ b/src/BBT.StructureTools.slnx @@ -0,0 +1,5 @@ + + + + + diff --git a/src/BBT.StructureTools/BBT.StructureTools.csproj b/src/BBT.StructureTools/BBT.StructureTools.csproj index 59832fc0..7167f95e 100644 --- a/src/BBT.StructureTools/BBT.StructureTools.csproj +++ b/src/BBT.StructureTools/BBT.StructureTools.csproj @@ -1,21 +1,16 @@  - netstandard2.0;net6.0 + netstandard2.0;net10.0 BBT.StructureTools - ..\BBT.StructureTools.ruleset bin\$(Configuration)\BBT.StructureTools.xml - bin\$(Configuration)\ true BBT StructureTools .NET classes for copying, comparing and converting object structures. - BBT.StructureTools - BBT Software AG BBT Software AG - Copyright © BBT Software AG BBT.StructureTools StructureTools Functional icon.png @@ -28,17 +23,13 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb;.xml - - full - - - - pdbonly - - - - + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + @@ -55,4 +46,4 @@ AllEnabledByDefault - \ No newline at end of file + diff --git a/src/BBT.StructureTools/Compare/Helper/Strategy/EqualityComparerHelperStrategyUtils.cs b/src/BBT.StructureTools/Compare/Helper/Strategy/EqualityComparerHelperStrategyUtils.cs index a44c31b3..ba85db3d 100644 --- a/src/BBT.StructureTools/Compare/Helper/Strategy/EqualityComparerHelperStrategyUtils.cs +++ b/src/BBT.StructureTools/Compare/Helper/Strategy/EqualityComparerHelperStrategyUtils.cs @@ -82,8 +82,10 @@ public static bool AreListEquivalent( var comparer = new DictionaryComparer(compareFunc); var counterDictionary = new Dictionary(comparer); + foreach (var item1 in list1List) { +#pragma warning disable CA1864 // Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method if (counterDictionary.ContainsKey(item1)) { counterDictionary[item1]++; @@ -92,6 +94,7 @@ public static bool AreListEquivalent( { counterDictionary.Add(item1, 1); } +#pragma warning restore CA1864 // Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method } foreach (var item2 in list2List) diff --git a/src/BBT.StructureTools/Convert/ConvertHelper.cs b/src/BBT.StructureTools/Convert/ConvertHelper.cs index 06e7a060..00661aba 100644 --- a/src/BBT.StructureTools/Convert/ConvertHelper.cs +++ b/src/BBT.StructureTools/Convert/ConvertHelper.cs @@ -54,7 +54,7 @@ public bool ContinueConvertProcess( source.NotNull(nameof(source)); additionalProcessings.NotNull(nameof(additionalProcessings)); - var interceptors = additionalProcessings.OfType>(); + var interceptors = additionalProcessings.OfType>().ToArray(); return !interceptors.Any() || interceptors.Any(x => x.CallConverter(source)); } } diff --git a/src/BBT.StructureTools/Copy/Helper/IInternalCopyHelperRegistration.cs b/src/BBT.StructureTools/Copy/Helper/IInternalCopyHelperRegistration.cs index 1cdd8472..8c2b0f02 100644 --- a/src/BBT.StructureTools/Copy/Helper/IInternalCopyHelperRegistration.cs +++ b/src/BBT.StructureTools/Copy/Helper/IInternalCopyHelperRegistration.cs @@ -12,6 +12,8 @@ internal interface IInternalCopyHelperRegistration : ICopyHelperRegistration< /// /// Ends the registrations and start the operation phase. /// +#pragma warning disable CS0108 // Member hides inherited member; missing new keyword ICopyOperation EndRegistrations(); +#pragma warning restore CS0108 // Member hides inherited member; missing new keyword } } diff --git a/src/BBT.StructureTools/Extension/EnumerableExtension.cs b/src/BBT.StructureTools/Extension/EnumerableExtension.cs index 0c0d6ae9..476fecca 100644 --- a/src/BBT.StructureTools/Extension/EnumerableExtension.cs +++ b/src/BBT.StructureTools/Extension/EnumerableExtension.cs @@ -19,6 +19,7 @@ internal static class EnumerableExtension internal static bool Only(this IEnumerable list) { list.NotNull(nameof(list)); + list = list as TEntity[] ?? list.ToArray(); if (!list.Any()) { diff --git a/src/BBT.StructureTools/Extension/LookupUtils.cs b/src/BBT.StructureTools/Extension/LookupUtils.cs index eea9b10d..bea97d36 100644 --- a/src/BBT.StructureTools/Extension/LookupUtils.cs +++ b/src/BBT.StructureTools/Extension/LookupUtils.cs @@ -23,7 +23,9 @@ internal static bool IsDefaultValue(T value) var defaultValue = default(T); +#pragma warning disable CA1508 // 'value.Equals(defaultValue)' is always 'false'. Remove or refactor the condition(s) to avoid dead code. var isDefault = value.Equals(defaultValue); +#pragma warning restore CA1508 // 'value.Equals(defaultValue)' is always 'false'. Remove or refactor the condition(s) to avoid dead code. return isDefault; } diff --git a/src/BBT.StructureTools/StructureToolsException.cs b/src/BBT.StructureTools/StructureToolsException.cs index 2ace067e..4151ec63 100644 --- a/src/BBT.StructureTools/StructureToolsException.cs +++ b/src/BBT.StructureTools/StructureToolsException.cs @@ -41,9 +41,12 @@ public StructureToolsException(string message, Exception innerException) /// /// The object that holds the serialized object data. /// The contextual information about the source or destination. +#pragma warning disable SYSLIB0051 // APIs that support legacy serialization are deprecated protected StructureToolsException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#pragma warning restore SYSLIB0051 // APIs that support legacy serialization are deprecated + } } diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000..b8d20a3b --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,23 @@ + + + BBT Software AG + BBT.StructureTools + Copyright © BBT Software AG + bin\$(Configuration)\ + + + + full + + + + pdbonly + + + + + + true + true + + diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props new file mode 100644 index 00000000..9b46bcd7 --- /dev/null +++ b/src/Directory.Packages.props @@ -0,0 +1,19 @@ + + + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/nuget.config b/src/nuget.config new file mode 100644 index 00000000..71cb5b3d --- /dev/null +++ b/src/nuget.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +