You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(nodeisStructDeclarationSyntaxsds&&sds.Modifiers.Any(SyntaxKind.PartialKeyword)&&sds.BaseListis not null)
21
+
// Partial (record) struct with some interface
22
+
if(nodeisTypeDeclarationSyntaxtds&&tdsisStructDeclarationSyntaxor RecordDeclarationSyntax{ClassOrStructKeyword.ValueText:"struct"}&&tds.Modifiers.Any(SyntaxKind.PartialKeyword)&&tds.BaseListis not null)
/* Supporting records has the following disadvantages:
33
-
* - Allows the use of automatic properties. This generates a constructor and init-properties, stimulating non-validated ValueObjects, an antipattern.
34
-
* - Overrides equality without an easy way to specify (or even think of) how to compare strings.
35
-
* - Overrides equality without special-casing collections.
36
-
* - Omits IComparable<T> and comparison operators.
32
+
/* Supporting records has the following issues:
33
+
* - Cannot inherit from a non-record class (and vice versa).
34
+
* - Promotes the use of "positional" (automatic) properties. This generates a constructor and init-properties, stimulating non-validated ValueObjects, an antipattern.
Assert.False(result,$"{nameof(ManualValueObject.ContainsNonPrintableCharactersOrDoubleQuotes)} (disallowing newlines and tabs) for '{chr}' ({i}) should have been false, but was true.");
417
+
else
418
+
Assert.True(result,$"{nameof(ManualValueObject.ContainsNonPrintableCharactersOrDoubleQuotes)} (disallowing newlines and tabs) for '{chr}' ({i}) should have been true, but was false.");
Assert.False(result,$"{nameof(ManualValueObject.ContainsNonPrintableCharactersOrDoubleQuotes)} (allowing newlines and tabs) for '{chr}' ({i}) should have been false, but was true.");
443
+
else
444
+
Assert.True(result,$"{nameof(ManualValueObject.ContainsNonPrintableCharactersOrDoubleQuotes)} (allowing newlines and tabs) for '{chr}' ({i}) should have been true, but was false.");
0 commit comments