Added assert in the test cases

Added assert in the test cases in all the required places.