コード例 #1
0
        public void ReturnIndex_ForSearchValueInArray(int[] testArray, int y, int z)
        {
            //Arrange

            //Act
            int result = SUT.FindLast(testArray, y);

            //Assert
            Assert.AreEqual(z, result);
        }
コード例 #2
0
        public void ThrowNullReferenceException_WhenArrayIsNull()
        {
            //Arrange
            int[] x = null;
            int   y = 7;

            //Act
            Assert.ThrowsException <NullReferenceException>(() => SUT.FindLast(x, y));

            //Assert
        }
コード例 #3
0
        public void ReturnMinus1_ForSearchValueNotInArray()
        {
            //Arrange
            int[] x = new int[] { 2, 3, 5 };
            int   y = 7;

            //Act
            int result = SUT.FindLast(x, y);

            //Assert
            Assert.AreEqual(result, -1);
        }