Exemple #1
0
 public void TargetRequiresRepeats()
 {
     Assert.IsTrue(Q04.HasThreeSum(new int[] { 1, 7, 9 }, 21));
     Assert.IsTrue(Q04.HasThreeSum(new int[] { 1, 7, 9 }, 27));
     Assert.IsTrue(Q04.HasThreeSum(new int[] { 1, 7, 9 }, 3));
 }
Exemple #2
0
 public void ExampleHasSum()
 {
     Assert.IsTrue(Q04.HasThreeSum(exampleArray, 21));
 }
Exemple #3
0
 public void ExampleNoSum()
 {
     Assert.IsFalse(Q04.HasThreeSum(exampleArray, 22));
 }
Exemple #4
0
 public void TargetIsGreaterThanMaxOrLessThanMin()
 {
     Assert.IsFalse(Q04.HasThreeSum(new int[] { 1, 7, 9 }, 10));
     Assert.IsFalse(Q04.HasThreeSum(new int[] { 1, 7, 9 }, 0));
 }