1- using System . Collections ;
1+ using System ;
2+ using System . Collections ;
23using System . Collections . Generic ;
34using System . Linq ;
45using Comparation . Tests . Core ;
@@ -11,6 +12,41 @@ public sealed class Cases : IEnumerable<TestCaseData>
1112 {
1213 private const string Category = "Equality" ;
1314
15+ private static EqualitySuite < IReadOnlyCollection < string ? > > StringSetSuite ( )
16+ {
17+ // ReSharper disable InconsistentNaming
18+ Named < IReadOnlyCollection < string ? > ? > nullSet = ( nameof ( nullSet ) , null ) ;
19+ Named < IReadOnlyCollection < string ? > ? > emptySet = ( nameof ( emptySet ) , Array . Empty < string > ( ) ) ;
20+ Named < IReadOnlyCollection < string ? > ? > singleNull = ( nameof ( singleNull ) , new string ? [ ] { null } ) ;
21+ Named < IReadOnlyCollection < string ? > ? > singleA = ( nameof ( singleA ) , new [ ] { "a" } ) ;
22+ Named < IReadOnlyCollection < string ? > ? > singleBigA = ( nameof ( singleBigA ) , new [ ] { "A" } ) ;
23+ Named < IReadOnlyCollection < string ? > ? > twoAs = ( nameof ( twoAs ) , new [ ] { "a" , "A" } ) ;
24+ Named < IReadOnlyCollection < string ? > ? > ab = ( nameof ( ab ) , new [ ] { "a" , "b" } ) ;
25+ Named < IReadOnlyCollection < string ? > ? > ba = ( nameof ( ba ) , new [ ] { "b" , "a" } ) ;
26+ Named < IReadOnlyCollection < string ? > ? > abc = ( nameof ( abc ) , new [ ] { "a" , "b" , "c" } ) ;
27+ Named < IReadOnlyCollection < string ? > ? > ab2c = ( nameof ( ab2c ) , new [ ] { "a" , "b" , "c" , "b" } ) ;
28+ Named < IReadOnlyCollection < string ? > ? > abnull = ( nameof ( abnull ) , new [ ] { "a" , "b" , null } ) ;
29+ Named < IReadOnlyCollection < string ? > ? > nullba = ( nameof ( nullba ) , new [ ] { null , "b" , "a" } ) ;
30+ // ReSharper restore InconsistentNaming
31+
32+ return new EqualitySuite < IReadOnlyCollection < string ? > > (
33+ nameof ( SetEquality < string > ) ,
34+ new SetEquality < string > (
35+ Comparation . Equality . Of < string > ( ) . By ( @string => @string . ToLowerInvariant ( ) )
36+ ) ,
37+ new [ ]
38+ {
39+ new [ ] { nullSet } ,
40+ new [ ] { emptySet } ,
41+ new [ ] { singleNull } ,
42+ new [ ] { singleA , singleBigA , twoAs } ,
43+ new [ ] { ab , ba } ,
44+ new [ ] { abc , ab2c } ,
45+ new [ ] { abnull , nullba }
46+ }
47+ ) ;
48+ }
49+
1450 public IEnumerator < TestCaseData > GetEnumerator ( ) => Sequence . Concat (
1551 new WorkAsExpected ( ) ,
1652 new Examples ( ) ,
@@ -19,7 +55,8 @@ public IEnumerator<TestCaseData> GetEnumerator() => Sequence.Concat(
1955 new GiveSameHashCodeForEqualObjects ( ) ,
2056 new TreatTreatsNullNotEqualToObject ( ) ,
2157 new Transitive ( ) ,
22- new Equal ( )
58+ new Equal ( ) ,
59+ StringSetSuite ( )
2360 )
2461 . Select ( @case => new NamePrefixing < Test > ( Category , @case ) )
2562 . Select ( @case => new TestCaseData ( @case . Value ) . SetName ( @case . Name ) . SetCategory ( Category ) )
0 commit comments