Exemple #1
0
        public void Return_Empty_Array_With_One_For_Loop()
        {
            var       array     = new[] { 3, 5, -4, 8, 11, 1, -1, 6 };
            const int targetSum = 20;

            var result = TwoSumNumber.OneForLoopSolution(array, targetSum);

            result.Count.Should().Be(0);
        }
Exemple #2
0
        public void Return_Expected_The_Two_Number_With_Order_With_One_For_Loop_Solution()
        {
            var       array     = new[] { 3, 5, -4, 8, 11, 1, -1, 6 };
            const int targetSum = 10;

            var result = TwoSumNumber.OneForLoopSolution(array, targetSum);

            result[0].Should().Be(-1);
            result[1].Should().Be(11);
        }