mirror of
https://onedev.fprog.nl/AioNet
synced 2026-03-06 09:34:08 +01:00
Added more unit tests for AioNet.Linq.
This commit is contained in:
parent
08acbe0bf8
commit
1797d05cf0
|
|
@ -15,4 +15,27 @@ public class ExtendedLinqTest
|
||||||
Assert.Contains(2, onlyCombination);
|
Assert.Contains(2, onlyCombination);
|
||||||
Assert.Contains(3, onlyCombination);
|
Assert.Contains(3, onlyCombination);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void FindThreeCombinationsFor3Elements_SubsequenceLength2()
|
||||||
|
{
|
||||||
|
var foundCombinations = new[] { 1, 2, 3 }.Combinations(2);
|
||||||
|
Assert.True(foundCombinations.Count() == 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData(1)]
|
||||||
|
[InlineData(2)]
|
||||||
|
[InlineData(3)]
|
||||||
|
[InlineData(4)]
|
||||||
|
[InlineData(5)]
|
||||||
|
public void EachSubsequenceIsCorrectLength(int subsequenceLength)
|
||||||
|
{
|
||||||
|
var foundCombinations = new[] { 1, 2, 3, 4, 5, 6 }.Combinations(subsequenceLength);
|
||||||
|
|
||||||
|
foreach (var foundCombination in foundCombinations)
|
||||||
|
{
|
||||||
|
Assert.True(foundCombination.Count() == subsequenceLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue