DCSIMG
Unit tests - Nati Dobkin

Browse by Tags

All Tags » Unit tests (RSS)
Testable code – is it worth it?
Recently I been refactoring some legasy code and writing a new one. I am using Rhino mocks to run my units and for that I have to write my code in a testable way. This approach makes my code looks not exactly the way I designed and want it to be. Eli Lopian wrote an article about this issue – " Stop Designing for Testability " and has some points to think of. In my opinion, if we have to write very simple code to encapsulate some internal logic for our base class and make sure that there...

Posted by Nati Dobkin | 3 comment(s)

תגים:

Mocking internal methods and classes with Rhino.Mocks
After my trip to Thailand Last month ( see some photos ) I back and jumped right in to coding. I wrote some code at work and tried to fix some unit tests for it using Rhino Mocks . I guess you all familiar with that powerful tool and I will not try to explain how to use it , it been done perfectly by some of my colleagues. I wrote a class like this: public class User { private void DoSomeLogic() { } public void Add() { DoSomeLogic(); // ... } } When I came up to write the test I realized that the...

Posted by Nati Dobkin | 2 comment(s)