public void TestMethodChangePhoneOfSingleContactMultipleTimes()
 {
     var phoneRepo = new PhonebookRepositoryNew();
     phoneRepo.AddPhone("Alfa", new string[] { "+359443455666" });
     phoneRepo.ChangePhone("+359443455666", "+359888888888");
     phoneRepo.ChangePhone("+359888888888", "+359777777777");
     phoneRepo.ChangePhone("+359777777777", "+359666666666");
     phoneRepo.ChangePhone("+359666666666", "+359555555555");
     var contactList = phoneRepo.ListEntries(0, 1);
     var expected = "[Alfa: +359555555555]";
     Assert.AreEqual(contactList[0].ToString(), expected);
 }
        public void TestMethodChangePhoneOfMultipleContacts()
        {
            var phoneRepo = new PhonebookRepositoryNew();
            phoneRepo.AddPhone("Alfa", new string[] { "+359443455666" });
            phoneRepo.AddPhone("Beta", new string[] { "+359443455666" });
            phoneRepo.AddPhone("Gama", new string[] { "+359443455666" });
            var numberOfPhoneChanged = phoneRepo.ChangePhone("+359443455666", "+359888888888");

            var contactList = phoneRepo.ListEntries(0, 3);
            var output = new StringBuilder();
            for (int i = 0; i < contactList.Count(); i++)
            {
                output.AppendLine(contactList[i].ToString());
            }
            var expected = "[Alfa: +359888888888]\r\n" +
                "[Beta: +359888888888]\r\n" +
                "[Gama: +359888888888]\r\n";
            Assert.AreEqual(contactList.Count(), 3);
            Assert.AreEqual(output.ToString(), expected);
        }
 public void TestMethodChangePhoneOfGIvenContacts()
 {
     var phoneRepo = new PhonebookRepositoryNew();
     phoneRepo.AddPhone("Alfa", new string[] { "+359443455666" });
     phoneRepo.AddPhone("Beta", new string[] { "+359443455666" });
     phoneRepo.AddPhone("Gama", new string[] { "+359443455666" });
     phoneRepo.AddPhone("Omega", new string[] { "+359444556789" });
     phoneRepo.AddPhone("Delta", new string[] { "+357665555666" });
     phoneRepo.AddPhone("Epsilon", new string[] { "+359443455666" });
     phoneRepo.ChangePhone("+359443455666", "+359888888888");
     var contactList = phoneRepo.ListEntries(0, 6);
     var output = new StringBuilder();
     for (int i = 0; i < contactList.Count(); i++)
     {
         output.AppendLine(contactList[i].ToString());
     }
     var expected = "[Alfa: +359888888888]\r\n" +
         "[Beta: +359888888888]\r\n" +
         "[Delta: +357665555666]\r\n" +
         "[Epsilon: +359888888888]\r\n" +
         "[Gama: +359888888888]\r\n" +
         "[Omega: +359444556789]\r\n";
     Assert.AreEqual(output.ToString(), expected);
 }