Example #1
0
        public void RandomTests2()
        {
            var letsAnswers = new string[] { "a", "b", "c", "d" };
            var letsStudent = new string[] { "a", "b", "c", "d", "" };

            for (int i = 0; i <= 100; i++)
            {
                int      arrLength  = Rnd.Next(4, 20);
                string[] rndAnswers = new string[arrLength];
                string[] rndStudent = new string[arrLength];

                for (int j = 0; j < arrLength; j++)
                {
                    rndAnswers[j] = letsAnswers[Rnd.Next(0, letsAnswers.Length)];
                    rndStudent[j] = letsStudent[Rnd.Next(0, letsStudent.Length)];
                }

                int    expected = Solution(rndAnswers, rndStudent);
                string message  = FailureMessage(rndAnswers, rndStudent, expected);
                int    actual   = KataCheckExam.CheckExam(rndAnswers, rndStudent);
                // Console.WriteLine(message);

                Assert.AreEqual(expected, actual, message);
            }
        }
Example #2
0
 public void SampleTest(string[] arr1, string[] arr2, int score)
 {
     Assert.AreEqual(score, KataCheckExam.CheckExam(arr1, arr2));
 }