Esempio n. 1
0
        /// <summary>
        /// Our second test: no element found
        /// </summary>
        public void Test2()
        {
            int[]      a        = { 1111, 1, 77, 2, 3, 4, 5, 6, 37, 68, 69, 701, 000, 15, 17999, 3 };
            int        n        = 14;
            List <int> expected = new List <int>()
            {
            };
            List <int> actual = ArrayFilterDigit.FilterDigit(a, n);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void Test3()
        {
            int[]      a        = { 1, 2, 3, 4, 5, 7, 2, 77, 107 };
            int        n        = 2;
            List <int> expected = new List <int>()
            {
                2, 2
            };
            List <int> actual = ArrayFilterDigit.FilterDigit(a, n);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        /// <summary>
        /// Our first test: 4 elements found
        /// </summary>
        public void Test1()
        {
            int[]      a        = { 7, 1, 2, 3, 4, 5, 6, 7, 68, 69, 70, 15, 17 };
            int        n        = 7;
            List <int> expected = new List <int>()
            {
                7, 7, 70, 17
            };
            List <int> actual = ArrayFilterDigit.FilterDigit(a, n);

            Assert.AreEqual(expected, actual);
        }
        /// <summary>
        /// Our first test: 1 element found includes 0
        /// </summary>
        public void FilterDigit1_2_3_4_5_7_2_77_107returned_0()
        {
            // arrange
            int[]      a        = { 1, 2, 3, 4, 5, 7, 2, 77, 107 };
            int        n        = 0;
            List <int> expected = new List <int>()
            {
                107
            };

            // act
            List <int> actual = ArrayFilterDigit.FilterDigit(a, n);

            // assert
            CollectionAssert.AreEqual(expected, actual);
        }