예제 #1
0
        public void Test2()
        {
            int[] a   = { 2, 3, 5, 10, 11, 200 };
            Sum   sum = new Sum()
            {
                Content = a, X = -1
            };
            Sum2 sum2 = new Sum2()
            {
                Content = a, X = -1
            };

            Tuple <int, int> result  = sum.Solve();
            Tuple <int, int> result2 = sum2.Solve();

            Assert.IsNull(result);
            Assert.IsNull(result2);
        }
예제 #2
0
        public void Test3()
        {
            int[] a   = { 2, 3, 5, 10, 11 };
            Sum   sum = new Sum()
            {
                Content = a, X = 14
            };
            Sum2 sum2 = new Sum2()
            {
                Content = a, X = 14
            };

            Tuple <int, int> result  = sum.Solve();
            Tuple <int, int> result2 = sum2.Solve();

            Assert.AreEqual(3, result.Item1);
            Assert.AreEqual(11, result.Item2);
            Assert.AreEqual(result.Item1, result2.Item1);
            Assert.AreEqual(result.Item2, result2.Item2);
        }
예제 #3
0
        public void Test1()
        {
            int[] a   = { 2, 3, 7, 4, 2, 9 };
            Sum   sum = new Sum()
            {
                Content = a, X = 4
            };
            Sum2 sum2 = new Sum2()
            {
                Content = a, X = 4
            };

            Tuple <int, int> result  = sum.Solve();
            Tuple <int, int> result2 = sum2.Solve();

            Assert.AreEqual(2, result.Item1);
            Assert.AreEqual(2, result2.Item1);
            Assert.AreEqual(result.Item1, result2.Item1);
            Assert.AreEqual(result.Item2, result2.Item2);
        }