Um, how did Dickens write historical fiction, when the time period he was writing about I believed was the Victorian Era?

He wrote two historical novels, A Tale of Two Cities (as MLE mentioned) and Barnaby Rudge (set during the Gordon Riots).
Math is not my strong point, but I do recall a few HF classics, like Alexandre Dumas's The Count of Monte Cristo, Charles Dickens' A Tale of Two Cities, Victor Hugo's The Hunchback of Notre Dame, Leo Tolstoy's War and Peace.....The only way to settle the issue of whether historical fiction produces proportionally fewer good books than other genres is to do a head count and some maths: how many HF books were written in the last 200 years or so and how many of those became recognized classics.