Exemple #1
0
    public void FindByUsernameThrowsExceptionIfArgumentIsNull()
    {
        var pDb = new PeopleDatabase();

        Assert.That(() => pDb.FindByUsername(null),
                    Throws.ArgumentNullException);
    }
Exemple #2
0
    public void FindByUsernameThrowsExceptionIfNoUserIsFound()
    {
        var pDb = new PeopleDatabase();

        Assert.That(() => pDb.FindByUsername("Pesho"),
                    Throws.InvalidOperationException);
    }
Exemple #3
0
        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)));
        }
Exemple #4
0
        public void FindByUsernameWhenArgumentIsNull()
        {
            var db = new PeopleDatabase();

            Assert.That(() => db.FindByUsername(null), Throws.ArgumentNullException);
        }
Exemple #5
0
        public void FindByUsernameWhenDoesntExist(string username)
        {
            var db = new PeopleDatabase(new Person(11, "Pesho"));

            Assert.That(() => db.FindByUsername(username), Throws.InvalidOperationException);
        }