Modified part of the test code to TableDrivenTests.