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); }
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); }
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); }