Skip to content

Commit

Permalink
Change Rank docs && Person sequence order
Browse files Browse the repository at this point in the history
  • Loading branch information
Head0nF1re committed Feb 9, 2024
1 parent 88a8be4 commit 38a261e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 36 deletions.
12 changes: 4 additions & 8 deletions Source/SuperLinq.Async/Rank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ public static partial class AsyncSuperEnumerable
{
/// <summary>
/// Ranks each item in the sequence in ascending order using a default comparer.
/// The rank is equal to index + 1 of the first next different item, the first item
/// has a rank of 1 (index 0 + 1).
/// The rank is equal to index + 1 of the first element of the item's equality set.
/// </summary>
/// <typeparam name="TSource">Type of item in the sequence</typeparam>
/// <param name="source">The sequence whose items will be ranked</param>
Expand All @@ -19,8 +18,7 @@ public static partial class AsyncSuperEnumerable

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

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

/// <summary>
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/>
/// using a caller-supplied comparer. The rank is equal to index + 1 of the first next
/// different item, the first item has a rank of 1 (index 0 + 1).
/// using a caller-supplied comparer. The rank is equal to index + 1 of the first element of the item's equality set.
/// </summary>
/// <typeparam name="TSource">The type of the elements in the source sequence</typeparam>
/// <param name="source">The sequence of items to rank</param>
Expand Down
8 changes: 4 additions & 4 deletions Source/SuperLinq.Async/RankBy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public static partial class AsyncSuperEnumerable
/// <summary>
/// Ranks each item in the sequence in ascending order by a specified key
/// using a default comparer. The rank is equal to index + 1 of the first
/// next different item, the first item has a rank of 1 (index 0 + 1).
/// element of the item's equality set.
/// </summary>
/// <typeparam name="TSource">The type of the elements in the source sequence</typeparam>
/// <typeparam name="TKey">The type of the key used to rank items in the sequence</typeparam>
Expand All @@ -26,7 +26,7 @@ public static partial class AsyncSuperEnumerable
/// <summary>
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/>
/// by a specified key using a default comparer. The rank is equal to index + 1 of the first
/// next different item, the first item has a rank of 1 (index 0 + 1).
/// element of the item's equality set.
/// </summary>
/// <typeparam name="TSource">The type of the elements in the source sequence</typeparam>
/// <typeparam name="TKey">The type of the key used to rank items in the sequence</typeparam>
Expand All @@ -50,7 +50,7 @@ public static partial class AsyncSuperEnumerable
/// <summary>
/// Ranks each item in the sequence in ascending order by a specified key
/// using a caller-supplied comparer. The rank is equal to index + 1 of the first
/// next different item, the first item has a rank of 1 (index 0 + 1).
/// element of the item's equality set.
/// </summary>
/// <typeparam name="TSource">The type of the elements in the source sequence</typeparam>
/// <typeparam name="TKey">The type of the key used to rank items in the sequence</typeparam>
Expand All @@ -74,7 +74,7 @@ public static partial class AsyncSuperEnumerable
/// <summary>
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/>
/// by a specified key using a caller-supplied comparer. The rank is equal to index + 1 of the first
/// next different item, the first item has a rank of 1 (index 0 + 1).
/// element of the item's equality set.
/// </summary>
/// <typeparam name="TSource">The type of the elements in the source sequence</typeparam>
/// <typeparam name="TKey">The type of the key used to rank items in the sequence</typeparam>
Expand Down
10 changes: 4 additions & 6 deletions Source/SuperLinq/Rank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public static partial class SuperEnumerable
{
/// <summary>
/// Ranks each item in the sequence in ascending order using a default comparer. The rank is equal to
/// index + 1 of the first next different item, the first item has a rank of 1 (index 0 + 1).
/// index + 1 of the first element of the item's equality set.
/// </summary>
/// <typeparam name="TSource">
/// Type of item in the sequence
Expand Down Expand Up @@ -32,7 +32,7 @@ public static partial class SuperEnumerable

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

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

/// <summary>
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/> using a
/// caller-supplied comparer. The rank is equal to index + 1 of the first next different item, the first item
/// has a rank of 1 (index 0 + 1).
/// caller-supplied comparer. The rank is equal to index + 1 of the first element of the item's equality set.
/// </summary>
/// <typeparam name="TSource">
/// The type of the elements in the source sequence
Expand Down
10 changes: 4 additions & 6 deletions Source/SuperLinq/RankBy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public static partial class SuperEnumerable
{
/// <summary>
/// Ranks each item in the sequence in ascending order by a specified key using a default comparer. The rank is
/// equal to index + 1 of the first next different item, the first item has a rank of 1 (index 0 + 1).
/// equal to index + 1 of the first element of the item's equality set.
/// </summary>
/// <typeparam name="TSource">
/// The type of the elements in the source sequence
Expand Down Expand Up @@ -41,8 +41,7 @@ public static partial class SuperEnumerable

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

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

/// <summary>
/// Ranks each item in the sequence in the order defined by <paramref name="sortDirection"/> by a specified key
/// using a caller-supplied comparer. The rank is equal to index + 1 of the first next different item, the first
/// item has a rank of 1 (index 0 + 1).
/// using a caller-supplied comparer. The rank is equal to index + 1 of the first element of the item's equality set.
/// </summary>
/// <typeparam name="TSource">
/// The type of the elements in the source sequence
Expand Down
6 changes: 3 additions & 3 deletions Tests/SuperLinq.Async.Test/DenseRankTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ public async Task TestRankByKeySelector()
},
new Person[]
{
new(Name: "Jes", Age: 30, ExpectedRank: 4),
new(Name: "Tim", Age: 23, ExpectedRank: 2),
new(Name: "Joe", Age: 23, ExpectedRank: 2),
new(Name: "Bob", Age: 11, ExpectedRank: 1),
new(Name: "Sam", Age: 11, ExpectedRank: 1),
new(Name: "Kim", Age: 11, ExpectedRank: 1),
new(Name: "Tim", Age: 23, ExpectedRank: 2),
new(Name: "Joe", Age: 23, ExpectedRank: 2),
new(Name: "Mel", Age: 28, ExpectedRank: 3),
new(Name: "Jim", Age: 28, ExpectedRank: 3),
new(Name: "Jes", Age: 30, ExpectedRank: 4),
},
};

Expand Down
6 changes: 3 additions & 3 deletions Tests/SuperLinq.Async.Test/RankTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,14 @@ public async Task TestRankByKeySelector()
},
new Person[]
{
new(Name: "Tim", Age: 23, ExpectedRank: 4),
new(Name: "Joe", Age: 23, ExpectedRank: 4),
new(Name: "Jes", Age: 30, ExpectedRank: 8),
new(Name: "Bob", Age: 11, ExpectedRank: 1),
new(Name: "Sam", Age: 11, ExpectedRank: 1),
new(Name: "Kim", Age: 11, ExpectedRank: 1),
new(Name: "Tim", Age: 23, ExpectedRank: 4),
new(Name: "Joe", Age: 23, ExpectedRank: 4),
new(Name: "Mel", Age: 28, ExpectedRank: 6),
new(Name: "Jim", Age: 28, ExpectedRank: 6),
new(Name: "Jes", Age: 30, ExpectedRank: 8),
},
};

Expand Down
6 changes: 3 additions & 3 deletions Tests/SuperLinq.Test/DenseRankTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ public static IEnumerable<object[]> GetPersonSequences1() =>
public static IEnumerable<object[]> GetPersonSequences2() =>
new[]
{
new Person(Name: "Jes", Age: 30, ExpectedRank: 4),
new Person(Name: "Tim", Age: 23, ExpectedRank: 2),
new Person(Name: "Joe", Age: 23, ExpectedRank: 2),
new Person(Name: "Bob", Age: 11, ExpectedRank: 1),
new Person(Name: "Sam", Age: 11, ExpectedRank: 1),
new Person(Name: "Kim", Age: 11, ExpectedRank: 1),
new Person(Name: "Tim", Age: 23, ExpectedRank: 2),
new Person(Name: "Joe", Age: 23, ExpectedRank: 2),
new Person(Name: "Mel", Age: 28, ExpectedRank: 3),
new Person(Name: "Jim", Age: 28, ExpectedRank: 3),
new Person(Name: "Jes", Age: 30, ExpectedRank: 4),
}
.GetTestingSequence(maxEnumerations: 3)
.Select(x => new object[] { x, });
Expand Down
6 changes: 3 additions & 3 deletions Tests/SuperLinq.Test/RankTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ public static IEnumerable<object[]> GetPersonSequences1() =>
public static IEnumerable<object[]> GetPersonSequences2() =>
new[]
{
new Person(Name: "Tim", Age: 23, ExpectedRank: 4),
new Person(Name: "Joe", Age: 23, ExpectedRank: 4),
new Person(Name: "Jes", Age: 30, ExpectedRank: 8),
new Person(Name: "Bob", Age: 11, ExpectedRank: 1),
new Person(Name: "Sam", Age: 11, ExpectedRank: 1),
new Person(Name: "Kim", Age: 11, ExpectedRank: 1),
new Person(Name: "Tim", Age: 23, ExpectedRank: 4),
new Person(Name: "Joe", Age: 23, ExpectedRank: 4),
new Person(Name: "Mel", Age: 28, ExpectedRank: 6),
new Person(Name: "Jim", Age: 28, ExpectedRank: 6),
new Person(Name: "Jes", Age: 30, ExpectedRank: 8),
}
.GetTestingSequence(maxEnumerations: 3)
.Select(x => new object[] { x, });
Expand Down

0 comments on commit 38a261e

Please sign in to comment.