Esempio n. 1
0
    public void FindByIdThrowsExceptionIfNoUserIsFound()
    {
        var pDb = new PeopleDatabase();

        Assert.That(() => pDb.FindById(5),
                    Throws.InvalidOperationException);
    }
Esempio n. 2
0
        public void FindByIdWhenIdNotPresent()
        {
            var db = new PeopleDatabase();

            db.Add(new Person(11, "Pesho"));

            Assert.That(() => db.FindById(1), Throws.InvalidOperationException);
        }
Esempio n. 3
0
        public void TestValidFindById()
        {
            var person = new Person(12, "Pesho");
            var db     = new PeopleDatabase();

            db.Add(person);

            Assert.That(person, Is.EqualTo(db.FindById(12)));
        }
Esempio n. 4
0
        public void FindByIdWhenValid()
        {
            var db = new PeopleDatabase();

            var person = new Person(11, "Pesho");

            db.Add(person);

            Assert.That(db.FindById(11), Is.EqualTo(person));
        }
Esempio n. 5
0
        public void FindByIdWhenArgumentIsNegative()
        {
            var db = new PeopleDatabase();

            Assert.That(() => db.FindById(-5), Throws.ArgumentException);
        }