-
-
Save onsah/4d7b720d0504427621a538a31b82417b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "PhoneBook.h" | |
#include <cassert> | |
int main(int argc, char const *argv[]) | |
{ | |
PhoneBook pb; | |
assert(pb.addPerson("onur")); | |
assert(pb.addPerson("can")); | |
assert(pb.addPerson("betul")); | |
assert(!pb.addPerson("onur")); | |
assert(pb.peoples() == 3); | |
assert(pb.addPhone("onUr", 123, 4544)); | |
assert(pb.addPhone("betuL", 123, 455)); | |
assert(pb.addPhone("Can", 34, 65)); | |
assert(!pb.addPhone("can", 34, 65)); | |
pb.displayAreaCode(123); | |
assert(pb.removePerson("betul")); | |
assert(!pb.removePerson("bEtul")); | |
pb.displayPerson("Onur"); | |
pb.displayPerson("betul"); | |
assert(pb.peoples() == 2); | |
assert(pb.addPerson("burak")); | |
assert(pb.addPhone("burak", 123, 65464)); | |
pb.displayAreaCode(123); | |
pb.displayAreaCode(34); | |
assert(!pb.addPerson("Burak")); | |
assert(pb.addPerson("sena")); | |
pb.displayPerson("Sena"); | |
assert(pb.addPhone("senA", 34, 434343)); | |
assert(pb.peoples() == 4); | |
assert(!pb.removePhone("onUr", 123, 6564)); | |
pb.displayAreaCode(35); | |
pb.displayPeople(); | |
for (int i = 0; i < 100; ++i) | |
assert(pb.addPerson("Person " + std::to_string(i))); | |
assert(pb.peoples() == 104); | |
for (int i = 0; i < 100; ++i) | |
assert(pb.addPhone("Person " + std::to_string(i), 13, i)); | |
for (int i = 0; i < 100; ++i) | |
assert(pb.removePhone("Person " + std::to_string(i), 13, i)); | |
for (int i = 0; i < 100; ++i) | |
assert(pb.removePerson("Person " + std::to_string(i))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment