示例#1
0
 public void EnumerateSubsetCombinations_ReturnsFourCombinations_ForTwoElementAndTwoSubsets()
 {
     TestHelper.AssertSequence(
         Set.EnumerateSubsetCombinations(new[] { 11, 19 }, 2),
         new[]
     {
         new[] { 11, 19 },
         new int[] { }
     },
         new[]
     {
         new[] { 11 },
         new[] { 19 }
     },
         new[]
     {
         new[] { 19 },
         new[] { 11 }
     },
         new[]
     {
         new int[] { },
         new[] { 11, 19 }
     });
 }
示例#2
0
 public void EnumerateSubsetCombinations_ReturnsTwoCombinations_ForOneElementAndTwoSubsets()
 {
     TestHelper.AssertSequence(
         Set.EnumerateSubsetCombinations(new[] { 10 }, 2),
         new[] { new[] { 10 }, new int[] { } },
         new[] { new int[] { }, new[] { 10 } });
 }
示例#3
0
 public void EnumerateSubsetCombinations_DoesNotCareIfDuplicates()
 {
     TestHelper.AssertSequence(
         Set.EnumerateSubsetCombinations(new[] { 1, 1 }, 2),
         new[]
     {
         new[] { 1, 1 },
         new int[] { }
     },
         new[]
     {
         new[] { 1 },
         new[] { 1 }
     },
         new[]
     {
         new[] { 1 },
         new[] { 1 }
     },
         new[]
     {
         new int[] { },
         new[] { 1, 1 }
     });
 }
示例#4
0
 public void EnumerateSubsetCombinations_ReturnsOneCombination_ForOneElementAndOneSubset()
 {
     TestHelper.AssertSequence(
         Set.EnumerateSubsetCombinations(new[] { 10 }, 1),
         new[] { new[] { 10 } });
 }
示例#5
0
 public void EnumerateSubsetCombinations_ReturnsNothing_ForEmptySequence()
 {
     TestHelper.AssertSequence(
         Set.EnumerateSubsetCombinations(new int[] { }, 1)
         );
 }
示例#6
0
 public void EnumerateSubsetCombinations_ThrowsException_ForSubsetsLessThanOne()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() =>
                                                 Set.EnumerateSubsetCombinations(new int[] { }, 0));
 }
示例#7
0
 public void EnumerateSubsetCombinations_ThrowsException_ForNullSequence()
 {
     Assert.Throws <ArgumentNullException>(() =>
                                           Set.EnumerateSubsetCombinations <int>(null, 1));
 }