public void Permutations() { var expected = new[] { new[] { 1, 2, 3 }, new[] { 1, 2, 4 }, new[] { 1, 2, 5 }, new[] { 1, 3, 4 }, new[] { 1, 3, 5 }, new[] { 1, 4, 5 }, new[] { 2, 3, 4 }, new[] { 2, 3, 5 }, new[] { 2, 4, 5 }, new[] { 3, 4, 5 }, }; Assert.Equal(expected, MatrixExtensions.Permutations(Enumerable.Range(1, 5), 3)); }