Skip to content

Commit 38a261e

Browse files
committed
Change Rank docs && Person sequence order
1 parent 88a8be4 commit 38a261e

File tree

8 files changed

+28
-36
lines changed

8 files changed

+28
-36
lines changed

Source/SuperLinq.Async/Rank.cs

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ public static partial class AsyncSuperEnumerable
44
{
55
/// <summary>
66
/// Ranks each item in the sequence in ascending order using a default comparer.
7-
/// The rank is equal to index + 1 of the first next different item, the first item
8-
/// has a rank of 1 (index 0 + 1).
7+
/// The rank is equal to index + 1 of the first element of the item's equality set.
98
/// </summary>
109
/// <typeparam name="TSource">Type of item in the sequence</typeparam>
1110
/// <param name="source">The sequence whose items will be ranked</param>
@@ -19,8 +18,7 @@ public static partial class AsyncSuperEnumerable
1918

2019
/// <summary>
2120
/// Ranks each item in the sequence in ascending order using a caller-supplied comparer.
22-
/// The rank is equal to index + 1 of the first next different item, the first item
23-
/// has a rank of 1 (index 0 + 1).
21+
/// The rank is equal to index + 1 of the first element of the item's equality set.
2422
/// </summary>
2523
/// <typeparam name="TSource">The type of the elements in the source sequence</typeparam>
2624
/// <param name="source">The sequence of items to rank</param>
@@ -35,8 +33,7 @@ public static partial class AsyncSuperEnumerable
3533

3634
/// <summary>
3735
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/>
38-
/// using a default comparer. The rank is equal to index + 1 of the first next different
39-
/// item, the first item has a rank of 1 (index 0 + 1).
36+
/// using a default comparer. The rank is equal to index + 1 of the first element of the item's equality set.
4037
/// </summary>
4138
/// <typeparam name="TSource">Type of item in the sequence</typeparam>
4239
/// <param name="source">The sequence whose items will be ranked</param>
@@ -51,8 +48,7 @@ public static partial class AsyncSuperEnumerable
5148

5249
/// <summary>
5350
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/>
54-
/// using a caller-supplied comparer. The rank is equal to index + 1 of the first next
55-
/// different item, the first item has a rank of 1 (index 0 + 1).
51+
/// using a caller-supplied comparer. The rank is equal to index + 1 of the first element of the item's equality set.
5652
/// </summary>
5753
/// <typeparam name="TSource">The type of the elements in the source sequence</typeparam>
5854
/// <param name="source">The sequence of items to rank</param>

Source/SuperLinq.Async/RankBy.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public static partial class AsyncSuperEnumerable
55
/// <summary>
66
/// Ranks each item in the sequence in ascending order by a specified key
77
/// using a default comparer. The rank is equal to index + 1 of the first
8-
/// next different item, the first item has a rank of 1 (index 0 + 1).
8+
/// element of the item's equality set.
99
/// </summary>
1010
/// <typeparam name="TSource">The type of the elements in the source sequence</typeparam>
1111
/// <typeparam name="TKey">The type of the key used to rank items in the sequence</typeparam>
@@ -26,7 +26,7 @@ public static partial class AsyncSuperEnumerable
2626
/// <summary>
2727
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/>
2828
/// by a specified key using a default comparer. The rank is equal to index + 1 of the first
29-
/// next different item, the first item has a rank of 1 (index 0 + 1).
29+
/// element of the item's equality set.
3030
/// </summary>
3131
/// <typeparam name="TSource">The type of the elements in the source sequence</typeparam>
3232
/// <typeparam name="TKey">The type of the key used to rank items in the sequence</typeparam>
@@ -50,7 +50,7 @@ public static partial class AsyncSuperEnumerable
5050
/// <summary>
5151
/// Ranks each item in the sequence in ascending order by a specified key
5252
/// using a caller-supplied comparer. The rank is equal to index + 1 of the first
53-
/// next different item, the first item has a rank of 1 (index 0 + 1).
53+
/// element of the item's equality set.
5454
/// </summary>
5555
/// <typeparam name="TSource">The type of the elements in the source sequence</typeparam>
5656
/// <typeparam name="TKey">The type of the key used to rank items in the sequence</typeparam>
@@ -74,7 +74,7 @@ public static partial class AsyncSuperEnumerable
7474
/// <summary>
7575
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/>
7676
/// by a specified key using a caller-supplied comparer. The rank is equal to index + 1 of the first
77-
/// next different item, the first item has a rank of 1 (index 0 + 1).
77+
/// element of the item's equality set.
7878
/// </summary>
7979
/// <typeparam name="TSource">The type of the elements in the source sequence</typeparam>
8080
/// <typeparam name="TKey">The type of the key used to rank items in the sequence</typeparam>

Source/SuperLinq/Rank.cs

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public static partial class SuperEnumerable
44
{
55
/// <summary>
66
/// Ranks each item in the sequence in ascending order using a default comparer. The rank is equal to
7-
/// index + 1 of the first next different item, the first item has a rank of 1 (index 0 + 1).
7+
/// index + 1 of the first element of the item's equality set.
88
/// </summary>
99
/// <typeparam name="TSource">
1010
/// Type of item in the sequence
@@ -32,7 +32,7 @@ public static partial class SuperEnumerable
3232

3333
/// <summary>
3434
/// Ranks each item in the sequence in ascending order using a caller-supplied comparer. The rank is equal to
35-
/// index + 1 of the first next different item, the first item has a rank of 1 (index 0 + 1).
35+
/// index + 1 of the first element of the item's equality set.
3636
/// </summary>
3737
/// <typeparam name="TSource">
3838
/// The type of the elements in the source sequence
@@ -63,8 +63,7 @@ public static partial class SuperEnumerable
6363

6464
/// <summary>
6565
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/> using a default
66-
/// comparer. The rank is equal to index + 1 of the first next different item, the first item has a rank of 1
67-
/// (index 0 + 1).
66+
/// comparer. The rank is equal to index + 1 of the first element of the item's equality set.
6867
/// </summary>
6968
/// <typeparam name="TSource">
7069
/// Type of item in the sequence
@@ -95,8 +94,7 @@ public static partial class SuperEnumerable
9594

9695
/// <summary>
9796
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/> using a
98-
/// caller-supplied comparer. The rank is equal to index + 1 of the first next different item, the first item
99-
/// has a rank of 1 (index 0 + 1).
97+
/// caller-supplied comparer. The rank is equal to index + 1 of the first element of the item's equality set.
10098
/// </summary>
10199
/// <typeparam name="TSource">
102100
/// The type of the elements in the source sequence

Source/SuperLinq/RankBy.cs

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public static partial class SuperEnumerable
44
{
55
/// <summary>
66
/// Ranks each item in the sequence in ascending order by a specified key using a default comparer. The rank is
7-
/// equal to index + 1 of the first next different item, the first item has a rank of 1 (index 0 + 1).
7+
/// equal to index + 1 of the first element of the item's equality set.
88
/// </summary>
99
/// <typeparam name="TSource">
1010
/// The type of the elements in the source sequence
@@ -41,8 +41,7 @@ public static partial class SuperEnumerable
4141

4242
/// <summary>
4343
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/> by a specified key
44-
/// using a default comparer. The rank is equal to index + 1 of the first next different item, the first item
45-
/// has a rank of 1 (index 0 + 1).
44+
/// using a default comparer. The rank is equal to index + 1 of the first element of the item's equality set.
4645
/// </summary>
4746
/// <typeparam name="TSource">
4847
/// The type of the elements in the source sequence
@@ -84,7 +83,7 @@ public static partial class SuperEnumerable
8483

8584
/// <summary>
8685
/// Ranks each item in the sequence in ascending order by a specified key using a caller-supplied comparer. The
87-
/// rank is equal to index + 1 of the first next different item, the first item has a rank of 1 (index 0 + 1).
86+
/// rank is equal to index + 1 of the first element of the item's equality set.
8887
/// </summary>
8988
/// <typeparam name="TSource">
9089
/// The type of the elements in the source sequence
@@ -126,8 +125,7 @@ public static partial class SuperEnumerable
126125

127126
/// <summary>
128127
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/> by a specified key
129-
/// using a caller-supplied comparer. The rank is equal to index + 1 of the first next different item, the first
130-
/// item has a rank of 1 (index 0 + 1).
128+
/// using a caller-supplied comparer. The rank is equal to index + 1 of the first element of the item's equality set.
131129
/// </summary>
132130
/// <typeparam name="TSource">
133131
/// The type of the elements in the source sequence

Tests/SuperLinq.Async.Test/DenseRankTest.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,14 @@ public async Task TestRankByKeySelector()
225225
},
226226
new Person[]
227227
{
228+
new(Name: "Jes", Age: 30, ExpectedRank: 4),
229+
new(Name: "Tim", Age: 23, ExpectedRank: 2),
230+
new(Name: "Joe", Age: 23, ExpectedRank: 2),
228231
new(Name: "Bob", Age: 11, ExpectedRank: 1),
229232
new(Name: "Sam", Age: 11, ExpectedRank: 1),
230233
new(Name: "Kim", Age: 11, ExpectedRank: 1),
231-
new(Name: "Tim", Age: 23, ExpectedRank: 2),
232-
new(Name: "Joe", Age: 23, ExpectedRank: 2),
233234
new(Name: "Mel", Age: 28, ExpectedRank: 3),
234235
new(Name: "Jim", Age: 28, ExpectedRank: 3),
235-
new(Name: "Jes", Age: 30, ExpectedRank: 4),
236236
},
237237
};
238238

Tests/SuperLinq.Async.Test/RankTest.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@ public async Task TestRankByKeySelector()
215215
},
216216
new Person[]
217217
{
218+
new(Name: "Tim", Age: 23, ExpectedRank: 4),
219+
new(Name: "Joe", Age: 23, ExpectedRank: 4),
220+
new(Name: "Jes", Age: 30, ExpectedRank: 8),
218221
new(Name: "Bob", Age: 11, ExpectedRank: 1),
219222
new(Name: "Sam", Age: 11, ExpectedRank: 1),
220223
new(Name: "Kim", Age: 11, ExpectedRank: 1),
221-
new(Name: "Tim", Age: 23, ExpectedRank: 4),
222-
new(Name: "Joe", Age: 23, ExpectedRank: 4),
223224
new(Name: "Mel", Age: 28, ExpectedRank: 6),
224225
new(Name: "Jim", Age: 28, ExpectedRank: 6),
225-
new(Name: "Jes", Age: 30, ExpectedRank: 8),
226226
},
227227
};
228228

Tests/SuperLinq.Test/DenseRankTest.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,14 @@ public static IEnumerable<object[]> GetPersonSequences1() =>
210210
public static IEnumerable<object[]> GetPersonSequences2() =>
211211
new[]
212212
{
213+
new Person(Name: "Jes", Age: 30, ExpectedRank: 4),
214+
new Person(Name: "Tim", Age: 23, ExpectedRank: 2),
215+
new Person(Name: "Joe", Age: 23, ExpectedRank: 2),
213216
new Person(Name: "Bob", Age: 11, ExpectedRank: 1),
214217
new Person(Name: "Sam", Age: 11, ExpectedRank: 1),
215218
new Person(Name: "Kim", Age: 11, ExpectedRank: 1),
216-
new Person(Name: "Tim", Age: 23, ExpectedRank: 2),
217-
new Person(Name: "Joe", Age: 23, ExpectedRank: 2),
218219
new Person(Name: "Mel", Age: 28, ExpectedRank: 3),
219220
new Person(Name: "Jim", Age: 28, ExpectedRank: 3),
220-
new Person(Name: "Jes", Age: 30, ExpectedRank: 4),
221221
}
222222
.GetTestingSequence(maxEnumerations: 3)
223223
.Select(x => new object[] { x, });

Tests/SuperLinq.Test/RankTest.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,14 @@ public static IEnumerable<object[]> GetPersonSequences1() =>
210210
public static IEnumerable<object[]> GetPersonSequences2() =>
211211
new[]
212212
{
213+
new Person(Name: "Tim", Age: 23, ExpectedRank: 4),
214+
new Person(Name: "Joe", Age: 23, ExpectedRank: 4),
215+
new Person(Name: "Jes", Age: 30, ExpectedRank: 8),
213216
new Person(Name: "Bob", Age: 11, ExpectedRank: 1),
214217
new Person(Name: "Sam", Age: 11, ExpectedRank: 1),
215218
new Person(Name: "Kim", Age: 11, ExpectedRank: 1),
216-
new Person(Name: "Tim", Age: 23, ExpectedRank: 4),
217-
new Person(Name: "Joe", Age: 23, ExpectedRank: 4),
218219
new Person(Name: "Mel", Age: 28, ExpectedRank: 6),
219220
new Person(Name: "Jim", Age: 28, ExpectedRank: 6),
220-
new Person(Name: "Jes", Age: 30, ExpectedRank: 8),
221221
}
222222
.GetTestingSequence(maxEnumerations: 3)
223223
.Select(x => new object[] { x, });

0 commit comments

Comments
 (0)