public void TestingConstructorAndPrinting() { BulgarianPhoneBook phoneBook = new BulgarianPhoneBook(TestPath); string[] entries = phoneBook.ListWholePhoneBook().Split('\n'); // (entries.Length - 1) because last printed row is empty row Assert.AreEqual(ExpedtedEntriesCount, entries.Length - 1); }
public void DeletingPairByName() { BulgarianPhoneBook phoneBook = new BulgarianPhoneBook(TestPath); string name = "TestA"; phoneBook.DeletePairByName(name); string[] entries = phoneBook.ListWholePhoneBook().Split('\n'); Assert.AreEqual(ExpedtedEntriesCount - 1, entries.Length - 1); }
public void TestingNewPair() { BulgarianPhoneBook phoneBook = new BulgarianPhoneBook(TestPath); string name = "Musala Soft"; string phoneNumber = "+359895112233"; phoneBook.AddNewPair(name, phoneNumber); string[] entries = phoneBook.ListWholePhoneBook().Split('\n'); Assert.AreEqual(ExpedtedEntriesCount + 1, entries.Length - 1); }