public void DeleteBug_WhenNotInDb_ShouldThrowExcetion()
        {
            var bug = GetValidTestBug();

            var dbContext = new BugLoggerDbContext();
            var repo      = new DbBugsRepository(dbContext);

            repo.Delete(bug);
            repo.Save();
        }
        public void DeleteBug_WhenInDb_ShouldRemoveBug()
        {
            var bug = GetValidTestBug();

            var dbContext = new BugLoggerDbContext();
            var repo      = new DbBugsRepository(dbContext);

            repo.Add(bug);
            repo.Save();

            var bugInDb = dbContext.Bugs.Find(bug.Id);

            Assert.IsNotNull(bugInDb);
            Assert.AreEqual(bug.Text, bugInDb.Text);

            repo.Delete(bug);
            repo.Save();

            bugInDb = dbContext.Bugs.Find(bug.Id);
            Assert.IsNull(bugInDb);
        }