One of the most popular naming conventions for unit tests, and the one that we use is writing out the expected behavior as a sentence with underscores(_) instead of spaces.

The only problem is typing all those underscores is kind of a pain. That’s where AutoHotKey comes in! AutoHotkey (AHK) is a free, open-source macro-creation and automation software for Windows that allows users to automate repetitive tasks. It has a powerful scripting language that can allow us to intercept a key and replace it with another key. I’ve taken advantage of this to create an AHK script that detects if “Scroll Lock” is on and automatically replace spaces with underscores if it is.

Simply add the above code to a new AHK script and run it and you will now be able to toggle underscores for spaces by hitting the Scroll Lock button!

Blake Helms

Blake Helms is a .NET Software Development Manager for EBSCO Industries, a global company with businesses in a range of industries including Information Services, Publishing and Digital Media, Outdoor Products, Real Estate, Manufacturing and Distribution, and Business Services, headquartered in Birmingham, Alabama. There he is responsible for several core business applications and has been a driver for software craftsmanship and creating a culture that promotes mentorship and continuous improvement. He is also the cofounder of the Birmingham .NET Meetup with a mission to promote good development practices and .NET technologies in the Birmingham, Alabama area. Blake is incredibly passionate about technology in all areas from writing code for work, to audio/video production for his church to automating his home.