I'm starting to introduce Formal Unit Testing in our company as we are having a project that's becoming bigger and bigger and on this project another guy is going to help me. So I need to be sure that what he does doesn't break up all and vice-versa.
I'd like to introduce a CI server too, but this will be the topic of other questions. Now the question is: I'm currently reading "The Art Of Unit Testing" (that's a suggested masterpiece!) and what the author underlines is that Unit Testing is different from Integration Testing. That's clear for me and, if I understood well, Business Logic unit testing should avoid to be dependent on database connections and so on. First of all: am I right?
So, supposing that I'm right (i.e. when I unit test my BLL I should stub the database), how will I do it? I've read that there are some framework for db mocking. Should I use one of these? Which do you use?
Next question: do you really think this is a correct way to do? I mean: in my project the BL interfaces with database through Entity Framework. So, for example, when the method "UpdateItem" in my BLL is called, it does something and then saves the ObjectContext. This ObjectContext is the Entity Framework dependency I need to remove in my BL. But what should I test in such a method? I really can't understand unit testing the BL layer without testing the DAL together... Can you give me some example?
Thanks a lot for your efforts!
Marco