mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
Remove Batch (#2274)
This commit is contained in:
@ -70,31 +70,6 @@ public class CoreHelpersTests
|
||||
Assert.Equal(expectedComb, comb);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(2, 5, new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 })]
|
||||
[InlineData(2, 3, new[] { 1, 2, 3, 4, 5 })]
|
||||
[InlineData(2, 1, new[] { 1, 2 })]
|
||||
[InlineData(1, 1, new[] { 1 })]
|
||||
[InlineData(2, 2, new[] { 1, 2, 3 })]
|
||||
public void Batch_Success(int batchSize, int totalBatches, int[] collection)
|
||||
{
|
||||
// Arrange
|
||||
var remainder = collection.Length % batchSize;
|
||||
|
||||
// Act
|
||||
var batches = collection.Batch(batchSize);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(totalBatches, batches.Count());
|
||||
|
||||
foreach (var batch in batches.Take(totalBatches - 1))
|
||||
{
|
||||
Assert.Equal(batchSize, batch.Count());
|
||||
}
|
||||
|
||||
Assert.Equal(batches.Last().Count(), remainder == 0 ? batchSize : remainder);
|
||||
}
|
||||
|
||||
/*
|
||||
[Fact]
|
||||
public void ToGuidIdArrayTVP_Success()
|
||||
|
Reference in New Issue
Block a user