Exemple #1
0
        public void TestDontExistPerson()
        {
            People people = new People();
            Person person = people.addPerson("c", "c", "c");

            Assert.IsFalse(people.existsPerson(new Person("", "", "")));
        }
Exemple #2
0
        public void TestGetPersonWithID()
        {
            People people = new People();
            Person person = new Person();

            people.addPerson(person);
            Assert.AreSame(person, people.getPerson(person.id).Item2);
        }
Exemple #3
0
        public void TestGetPerson()
        {
            People people = new People();
            Person person = new Person("c", "c", "c");

            people.addPerson(person);
            Person result = people.getPerson(person);

            Assert.AreSame(person, result);
        }
Exemple #4
0
 public void TestExistsIdLarge()
 {
     People people = new People();
     for (int i = 0; i < 100000; i++)
     {
         people.addPerson("", "", "");
     }
     Person person = new Person();
     person = people.addPerson(person);
     Assert.IsTrue(people.existsPerson(person.id));
 }
Exemple #5
0
        public void TestGetPersonWithIDFail()
        {
            People people = new People();
            Person person = new Person();

            people.addPerson(person);

            Assert.AreEqual(false, people.getPerson(2).Item1);
        }
Exemple #6
0
 public void TestGetPersonFail()
 {
     People people = new People();
     Assert.IsFalse(people.getPerson(0).Item1);
 }
Exemple #7
0
 public void TestExistsPerson()
 {
     People people = new People();
     Person person = people.addPerson("c", "c", "c");
     Assert.IsTrue(people.existsPerson(person));
 }
Exemple #8
0
        public void TestRemovePerson()
        {
            People people = new People();
            Person person = new Person("Christoffer", "Holmgren", "07382344460");

            people.addPerson(person);
            Assert.IsTrue(people.existsPerson(person));

            people.removePerson(person);
            Assert.IsFalse(people.existsPerson(person));
        }
Exemple #9
0
 public void TestRemoveNonExistant()
 {
     People people = new People();
     people.removePerson(new Person());
 }
Exemple #10
0
 public void TestOneEmptyNotSameAsNewEmpty()
 {
     People people = new People();
     people.addPerson(new Person());
     Assert.IsFalse(people.getPerson(0).Equals(new Person()));
 }