Exemple #1
0
        public void Null_FindIndexTest()
        {
            // arrange
            int[] array = null;

            // act
            // assert
            Assert.ThrowsException <NullReferenceException>(() => FindIndex.Exec(array));
        }
Exemple #2
0
        public void NegativeValue_FindIndexTest()
        {
            // arrange
            int[] array    = { -2, 8, -7, 4, 8, -9 };
            Int16 expected = 3;

            // act
            int result = FindIndex.Exec(array);

            // assert
            Assert.AreEqual(expected, result);
        }
Exemple #3
0
        public void NullDim_FindIndexTest()
        {
            // arrange
            int[] array    = {};
            int   expected = -1;

            // act
            int result = FindIndex.Exec(array);

            // assert
            Assert.AreEqual(expected, result);
        }
Exemple #4
0
        public void Normal_FindIndexTest()
        {
            // arrange
            int[] array    = { 2, 8, 7, 4, 9, 8 };
            Int16 expected = 3;

            // act
            int result = FindIndex.Exec(array);

            // assert
            Assert.AreEqual(expected, result);
        }