public void FindTargetSumWaysTests() { TargetSum obj = new TargetSum(); var str = new int[] { 1, 1, 1, 1, 1 }; var x = obj.FindTargetSumWays(str, 3);//5 str = new int[] { 1, 1, 1, 1, 1, 1 }; x = obj.FindTargetSumWays(str, 4);//6 }
public void TestMethod1(int[] nums, int S, int expected) { // Arrange TargetSum question = new TargetSum(); // Act int actual = question.FindTargetSumWays(nums, S); // Assert Assert.AreEqual(expected, actual); }
public void Given_array_When_find_Then_return() { var nums = new int[] { 1, 1, 1, 1, 1 }; Assert.AreEqual(5, TargetSum.FindTargetSumWays(nums, 3)); }