Beispiel #1
0
        public void CtorAddsMoreThan16ThrowsExc(int num)
        {
            db = new ExtendedDatabase.Database();
            Person[] people = new Person[num];
            for (int i = 0; i < num; i++)
            {
                Person person = new Person(i + 1, $"Existing {i + 1}");
                people[i] = person;
            }

            Assert.Throws <ArgumentException>(() => new ExtendedDatabase.Database(people));
        }
Beispiel #2
0
        public void Setup()
        {
            Person[] persons = new Person[15];

            for (long i = 0; i < 15; i++)
            {
                Person person = new Person(i + 1, $"Existing {i+1}");
                persons[i] = person;
            }

            db = new ExtendedDatabase.Database(persons);
        }
Beispiel #3
0
        public void CtorAddsPeopleCorrectly(int num)
        {
            db = new ExtendedDatabase.Database();
            Person[] people = new Person[num];
            for (int i = 0; i < num; i++)
            {
                Person person = new Person(i + 1, $"Existing {i+1}");
                people[i] = person;
            }

            db = new ExtendedDatabase.Database(people);

            Assert.AreEqual(num, db.Count);
        }
Beispiel #4
0
 public void RemoveFromEmptyDBThrowsException()
 {
     db = new ExtendedDatabase.Database();
     Assert.Throws <InvalidOperationException>(() => db.Remove());
 }