示例#1
0
        public void TestFindUserByUserNameThrowsArgumentNullException()
        {
            IPerson  person1 = new Person("asd", 234);
            IPerson  person2 = new Person("asDa", 2346);
            Database db      = new Database(person1, person, person2);
            long     foundPersonID;

            Assert.That(() => foundPersonID = db.FindByUserName(null).Id, Throws.ArgumentNullException);
        }
示例#2
0
        public void TestFindUserByUserNameThrowsInvalidOperationException(string name)
        {
            IPerson  person1 = new Person("asd", 234);
            IPerson  person2 = new Person("asDa", 2346);
            Database db      = new Database(person1, person, person2);

            long foundPersonID;

            Assert.That(() => foundPersonID = db.FindByUserName(name).Id, Throws.InvalidOperationException);
        }
示例#3
0
        public void TestFindUserByUserNameSuccessfully(string name, long id)
        {
            IPerson  person1 = new Person("asd", 234);
            IPerson  person2 = new Person("asDa", 2346);
            Database db      = new Database(person1, person, person2);

            var foundPersonID = db.FindByUserName(name).Id;

            Assert.AreEqual(id, foundPersonID);
        }