Skip to content

Commit 86f647f

Browse files
Update for .net 9.0
1 parent 4f1ba52 commit 86f647f

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/Chapter16.Tests/Listing16.15.Tests.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public void SelectingAnonymousTypeFollowingGroupClause()
1313
string expected = dotnetCoreVersion switch
1414
{
1515
// Version <= 5
16-
string value when string.Compare(value, "6")<0 => """
16+
string value when string.Compare(value, "6") < 0 => """
1717
Aggregate, All, Any, Append, AsEnumerable, Average, Cast, Concat, Contains,
1818
Count, DefaultIfEmpty, Distinct, ElementAt, ElementAtOrDefault, Empty,
1919
Except, First, FirstOrDefault, GroupBy, GroupJoin, Intersect, Join, Last,
@@ -35,8 +35,8 @@ string value when value.StartsWith("6") => """
3535
ThenByDescending, ToArray, ToDictionary, ToHashSet, ToList,
3636
ToLookup, TryGetNonEnumeratedCount, Union, UnionBy, Where, Zip,
3737
""",
38-
// Version 7
39-
_ => """
38+
// Version 7-8
39+
string value when Version.TryParse(value, out var v) && (v.Major is 7 or 8) => """
4040
Aggregate, All, Any, Append, AsEnumerable, Average, Cast,
4141
Chunk, Concat, Contains, Count, DefaultIfEmpty, Distinct, DistinctBy,
4242
ElementAt, ElementAtOrDefault, Empty, Except, ExceptBy, First,
@@ -47,6 +47,19 @@ string value when value.StartsWith("6") => """
4747
SingleOrDefault, Skip, SkipLast, SkipWhile, Sum, Take, TakeLast,
4848
TakeWhile, ThenBy, ThenByDescending, ToArray, ToDictionary, ToHashSet,
4949
ToList, ToLookup, TryGetNonEnumeratedCount, Union, UnionBy, Where, Zip,
50+
""",
51+
// Version 9
52+
_ => """
53+
Aggregate, AggregateBy, All, Any, Append, AsEnumerable, Average, Cast,
54+
Chunk, Concat, Contains, Count, CountBy, DefaultIfEmpty, Distinct, DistinctBy,
55+
ElementAt, ElementAtOrDefault, Empty, Except, ExceptBy, First,
56+
FirstOrDefault, GroupBy, GroupJoin, Index, Intersect, IntersectBy, Join,
57+
Last, LastOrDefault, LongCount, Max, MaxBy, Min, MinBy, OfType,
58+
Order, OrderBy, OrderByDescending, OrderDescending, Prepend, Range,
59+
Repeat, Reverse, Select, SelectMany, SequenceEqual, Single,
60+
SingleOrDefault, Skip, SkipLast, SkipWhile, Sum, Take, TakeLast,
61+
TakeWhile, ThenBy, ThenByDescending, ToArray, ToDictionary, ToHashSet,
62+
ToList, ToLookup, TryGetNonEnumeratedCount, Union, UnionBy, Where, Zip,
5063
"""
5164
};
5265

0 commit comments

Comments
 (0)