Exemple #1
0
        public void TwoSumArrayLongSuccess()
        {
            var test = new TwoSumClass();

            int[] input  = { 2, 8, 11, 15, 7 };
            var   target = 9;

            int[] expect = { 0, 4 };
            int[] actual = test.Convert(input, target);
            Assert.AreEqual(expect[0], actual[0]);
            Assert.AreEqual(expect[1], actual[1]);
        }
Exemple #2
0
        public void TwoSumError()
        {
            var test = new TwoSumClass();

            int[] input  = { 2, 8, 11, 15 };
            var   target = 9;

            int[] expect = { 404, 404 };
            int[] actual = test.Convert(input, target);
            Assert.AreEqual(expect[0], actual[0]);
            Assert.AreEqual(expect[1], actual[1]);
        }