public void ReturnIndex_ForSearchValueInArray(int[] testArray, int y, int z) { //Arrange //Act int result = SUT.FindLast(testArray, y); //Assert Assert.AreEqual(z, result); }
public void ThrowNullReferenceException_WhenArrayIsNull() { //Arrange int[] x = null; int y = 7; //Act Assert.ThrowsException <NullReferenceException>(() => SUT.FindLast(x, y)); //Assert }
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); }