Exemplo n.º 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));
 }
Exemplo n.º 2
0
 public void ExampleHasSum()
 {
     Assert.IsTrue(Q04.HasThreeSum(exampleArray, 21));
 }
Exemplo n.º 3
0
 public void ExampleNoSum()
 {
     Assert.IsFalse(Q04.HasThreeSum(exampleArray, 22));
 }
Exemplo n.º 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));
 }