Write the unit test cases for grid function.