public void DuplicateNumbersAddPhoneTest()
        {
            PhonebookRepository phonebook = new PhonebookRepository();

            int contactsEntered = 0;
            for (int i = 0; i < 2; i++)
            {
                string name = "Lili" + i;
                string[] numbers = { "0899 777 23" };
                bool result = phonebook.AddPhone(name, numbers);
                if (result)
                {
                    contactsEntered++;
                }
            }

            Assert.AreEqual(2, contactsEntered);
        }
        public void InvalidCountListEntriesTest()
        {
            string name = "Lili";
            string[] numbers = { "0899 777 235" };

            PhonebookRepository phonebook = new PhonebookRepository();
            phonebook.AddPhone(name, numbers);
            var result = phonebook.ListEntries(0, 3);
        }
 public void EmptyPhonebookListEntriesTest()
 {
     PhonebookRepository phonebook = new PhonebookRepository();
     var result = phonebook.ListEntries(0, 1);
 }
        public void SingleNameWithMultipleNumbersAddPhoneTest()
        {
            PhonebookRepository phonebook = new PhonebookRepository();

            int contactsEntered = 0;
            int phonesAdded = 0;
            List<string> numbers = new List<string>();
            for (int i = 0; i < 3; i++)
            {
                string name = "Lili";
                numbers.Add("0899 777 23" + i);
                bool result = phonebook.AddPhone(name, numbers.ToArray());
                if (result)
                {
                    contactsEntered++;
                    phonesAdded++;
                }
                else
                {
                    phonesAdded++;
                }
            }
            Assert.AreEqual(1, contactsEntered);
            Assert.AreEqual(3, phonesAdded);
        }
        public void SingleEntryListEntriesTest()
        {
            string name = "Lili";
            string[] numbers = { "0899 777 235" };

            PhonebookRepository phonebook = new PhonebookRepository();
            phonebook.AddPhone(name, numbers);
            var result = phonebook.ListEntries(0, 1);
            Assert.AreEqual(1, result.Count());
        }
        public void SingleEntryChange()
        {
            string name = "Lili";
            string[] numbers = { "0899 777 235" };

            PhonebookRepository phonebook = new PhonebookRepository();
            phonebook.AddPhone(name, numbers);

            int result = phonebook.ChangePhone("0899 777 235", "4");
            Assert.AreEqual(1, result);
        }
        public void SingleEntryAddPhoneTest()
        {
            string name = "Lili";
            string[] numbers = { "0899 777 235" };

            PhonebookRepository phonebook = new PhonebookRepository();
            bool result = phonebook.AddPhone(name, numbers);
            Assert.IsTrue(result);
        }
        public void MultiplePhonesChangePhoneTest()
        {
            PhonebookRepository phonebook = new PhonebookRepository();

            int contactsEntered = 0;
            for (int i = 0; i < 5; i++)
            {
                string name = "Lili" + i;
                string[] numbers = {"0899 777 23"};
            }
            int result = phonebook.ChangePhone("0899 777 23", "53426");
            Assert.AreEqual(5, result);
        }