Exemplo n.º 1
0
        public void TestSmallestWithNullReferenceException()
        {
            ExceptionHandlingCase exceptionHandlingCase = new ExceptionHandlingCase();

            int[] arr = null;

            //Act
            int actualValue = exceptionHandlingCase.Smallest(arr);
        }
Exemplo n.º 2
0
        public void TestSmallestWithSizeZero()
        {
            ExceptionHandlingCase exceptionHandlingCase = new ExceptionHandlingCase();

            int[] arr           = { 12 };
            int   expectedValue = 12;

            //Act
            int actualValue = exceptionHandlingCase.Smallest(arr);

            //Assert
            Assert.AreEqual(expectedValue, actualValue);
        }
Exemplo n.º 3
0
        public void TestSmallest()
        {
            ExceptionHandlingCase exceptionHandlingCase = new ExceptionHandlingCase();

            int[] arr           = { 12, 6, 8, 1, 7, 9, 23 };
            int   expectedValue = 1;

            //Act
            int actualValue = exceptionHandlingCase.Smallest(arr);

            //Assert
            Assert.AreEqual(expectedValue, actualValue);
        }
Exemplo n.º 4
0
        public void TestSmallestWithNullValue()
        {
            try
            {
                ExceptionHandlingCase exceptionHandlingCase = new ExceptionHandlingCase();
                int[] arr = null;

                //Act
                int actualValue = exceptionHandlingCase.Smallest(arr);
            }
            catch (Exception e)
            {
                //Assert
                throw new AssertFailedException(e.Message, e);
            }
        }