public void TestCompareTwoPersonFirstOneWithTheSmallerScore()
        {
            Person firstPerson  = new Person("Pesho", 5);
            Person secondPerson = new Person("Vanya", 15);
            PersonScoreComparer personScoreComparer = new PersonScoreComparer();

            int result = personScoreComparer.Compare(firstPerson, secondPerson);

            Assert.AreEqual(-1, result);
        }
        public void TestCompareTwoPersonWithDifferentScore()
        {
            Person firstPerson  = new Person("Pesho", 15);
            Person secondPerson = new Person("Vanya", 10);
            PersonScoreComparer personScoreComparer = new PersonScoreComparer();

            int result = personScoreComparer.Compare(firstPerson, secondPerson);

            Assert.AreEqual(1, result);
        }
 public void AddToTopScoreList(Person person)
 {
     topScoreList.Add(person);
     PersonScoreComparer comparer = new PersonScoreComparer();
     topScoreList.Sort(comparer);
     while (topScoreList.Count > 5)
     {
         topScoreList.RemoveAt(5);
     }
 }
 public bool IsTopScore(Person person)
 {
     if (topScoreList.Count >= MAX_TOP_SCORE_COUNT)
     {
         PersonScoreComparer comparer = new PersonScoreComparer();
         topScoreList.Sort(comparer);
         if (topScoreList[MAX_TOP_SCORE_COUNT - 1] > person)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
     return true;
 }