Sunday, October 07, 2007

Including Unit Testing

It struck me as a great idea to include NUnit test in the next release of my SQLite query browser. If the program crashes or misbehaves, users can run the tests, find out why and either report to me or fix it themselves. Being one person and writing this program as a hobby, I don't have the capacity of testing that many different platforms and setups myself.

Let me show you what I have in mind:

The user clicks help-> run tests from the toolstrip

NUnit starts

The NUnit licence says: "Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely (...)"

I've included the entire NUnit bin directory and my test library dll in the project root and these few lines of code on the toolstrip onclick event:

private void runTestsToolStripMenuItem_Click(object sender, EventArgs e)
Process nunit = new Process();

nunit.StartInfo.FileName = Application.StartupPath + "\\nunit\\nunit.exe";
nunit.StartInfo.Arguments = "SQLiteQHTest.dll /run";


kick it on