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)); }
public void ExampleHasSum() { Assert.IsTrue(Q04.HasThreeSum(exampleArray, 21)); }
public void ExampleNoSum() { Assert.IsFalse(Q04.HasThreeSum(exampleArray, 22)); }
public void TargetIsGreaterThanMaxOrLessThanMin() { Assert.IsFalse(Q04.HasThreeSum(new int[] { 1, 7, 9 }, 10)); Assert.IsFalse(Q04.HasThreeSum(new int[] { 1, 7, 9 }, 0)); }