public void TestCalculateGradesMinAndMaxOfAllGrades()
        {
            converter.Marks = new int[]
            {
                0, 39, 40, 49, 50, 59, 60, 69, 70, 100
            };

            Grades[] expectedGrades = new Grades[]
            {
                //Grade F
                (Grades)0, (Grades)0,

                //Grade D
                (Grades)1, (Grades)1,

                //Grade C
                (Grades)2, (Grades)2,

                //Grade B
                (Grades)3, (Grades)3,

                //Grade A
                (Grades)4, (Grades)4,
            };

            converter.CalculateGrades();

            //Testing the items of the expected array items
            // and the actual array items are they equal
            CollectionAssert.AreEqual(converter.Grades, expectedGrades);
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Yellow;


            Console.WriteLine();
            ConsoleHelper.OutputHeading("BNU CO453 Applications Programming 2020-2021!");

            string[] choices = { "Distance Converter", "BMI Calculator", "Student Grades",
                                 "Social Network",     "Rock-Paper-Scissors Game" };
            int      choiceNo = ConsoleHelper.SelectChoice(choices);


            String choice = Console.ReadLine();

            if (choiceNo == 1)
            {
                converter.ConvertDistance();
            }
            else if (choiceNo == 2)
            {
                calculator.CalculateIndex();
            }
            else if (choiceNo == 3)
            {
                grades.CalculateGrades();
            }
            else if (choiceNo == 4)
            {
                app04.DisplayMenu();
            }
            else if (choiceNo == 5)
            {
                app05.Play();
            }
            else
            {
                Console.WriteLine("Invalid Choice!");
            }
        }