Writes test cases