Am I officially a “nerd”??
okay i know this is lame.. but i am seriously getting a high from writing unit test cases.. seriously it’s such a rush to see 243 test cases all run AND pass in a matter of seconds… if i don’t stop i am afraid i’ll turn into a “testaholic”
what is the best way of testing, should you go to db and pull data or stub/fake data?
Depends on what kind of testing you’re doing. If it’s unit testing, then you should stub out the DB layer for at least the following reasons. 1. You have more control over the fake data, 2. There is no reason to run all the logic is the DB layer since you are unit testing. 2. Your unit test will be much faster.
If you are doing an integrated test then yes you should hit the DB and run all the logic in between that.
Hope this helps!