Tagged Questions
4
votes
1answer
294 views
Is wrapping a third party code the only solution to unit test its consumers?
I'm doing unit testing and in one of my classes I need to send a mail from one of the methods, so using constructor injection I inject an instance of Zend_Mail class which is in Zend framework.
Now ...
4
votes
4answers
281 views
Are injectable classes allowed to have constructor parameters in DI?
Given the following code:
class ClientClass{
public function print(){
//some code to calculate $inputString
$parser= new Parser($inputString);
$result= ...
12
votes
5answers
2k views
What are the design principles that promote testable code? (designing testable code vs driving design through tests)
Most of the projects that I work on consider development and unit testing in isolation which makes writing unit tests at a later instance a nightmare. My objective is to keep testing in mind during ...
10
votes
4answers
796 views
Does test-driven development force me to follow SOLID?
I hear a lot from TDD practitioners that one of TDD's advantages is that it forces developers to follow SOLID principles (Single responsibility, Open-closed, Liskov substitution, Interface segregation ...