O'Reilly logo

Extreme Programming Adventures in C# by Ron Jeffries

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Find a Bug, Write a Test

Last time out, I found a bug. Our rules of engagement require us to write a test, first to show that the bug exists and later to verify that we have fixed it, but we don’t know how to write that test! We get by with a little help from our friends.

Oh No, There’s a Bug!

In the previous chapter, I found a defect in the program: when insertion of a new set of paragraph tags takes you below the bottom of the window, the text doesn’t scroll up to keep the cursor on the screen. You have to keep clicking on the scroll bars to bring the line back up.

It took me only a little while to find and fix the defect. Here’s the code, from the XMLNotepad class, with the fix. That’s what we’re going to work on today:

void XMLKeyDownHandler(object ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required