Sometimes I end up writing unit test cases for code that other developers have written. There are occasions when I really don't know what the developer is trying to do (the business part) and I just manipulate the test case to get the green line. Are these things normal in the industry?
What is the normal trend? Are the developers supposed to write unit test cases for code they wrote themselves?
Best Answer
Try reading this blog post: Writing Great Unit Tests: Best and Worst Practices.
But there are countless others on the web.
In direct answer to your questions...
And the way you described of writing the tests (in your question) is totally wrong!!