Beispiel #1
0
        public void GetSecondHighestValue_Success()
        {
            var intfunc  = new IntegerFunctions();
            int expected = 7;

            int[] val    = { 7, 20, 2 };
            int   result = intfunc.GetSecondHighestValue(val);

            Assert.AreEqual(expected, result, $"{result} is the second highest.");
        }
Beispiel #2
0
        protected void btnCheckSecondHighestValue_Click(object sender, EventArgs e)
        {
            var intfunc = new IntegerFunctions();

            int val1 = 0;

            int.TryParse(this.txtSecondHighestValue1.Text.ToString(), out val1);
            int val2 = 0;

            int.TryParse(this.txtSecondHighestValue2.Text.ToString(), out val2);
            int val3 = 0;

            int.TryParse(this.txtSecondHighestValue3.Text.ToString(), out val3);

            int[] val    = { val1, val2, val3 };
            int   result = intfunc.GetSecondHighestValue(val);

            this.lblSecondHighestValueResult.Text = result.ToString();
        }