Writing and running a test case