public void FindByUsernameThrowsExceptionIfArgumentIsNull() { var pDb = new PeopleDatabase(); Assert.That(() => pDb.FindByUsername(null), Throws.ArgumentNullException); }
public void FindByUsernameThrowsExceptionIfNoUserIsFound() { var pDb = new PeopleDatabase(); Assert.That(() => pDb.FindByUsername("Pesho"), Throws.InvalidOperationException); }
public void TestValidFindByUsername() { string username = "******"; var db = new PeopleDatabase(); var person = new Person(12, username); db.Add(person); Assert.That(person, Is.EqualTo(db.FindByUsername(username))); }
public void FindByUsernameWhenArgumentIsNull() { var db = new PeopleDatabase(); Assert.That(() => db.FindByUsername(null), Throws.ArgumentNullException); }
public void FindByUsernameWhenDoesntExist(string username) { var db = new PeopleDatabase(new Person(11, "Pesho")); Assert.That(() => db.FindByUsername(username), Throws.InvalidOperationException); }