tag:blogger.com,1999:blog-804807863784809914.post1644192509432968311..comments2024-03-28T09:46:41.753+01:00Comments on Legend and truth: Unit testing patternPatrik Hägnehttp://www.blogger.com/profile/09722697680972465898noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-804807863784809914.post-17354015544861587212008-02-26T23:17:00.000+01:002008-02-26T23:17:00.000+01:00I don't agree with that haqwin, as long as the SUT...I don't agree with that haqwin, as long as the SUT doesn't have any Conditional-attributes set on them or pre-processor if-statements then the code won't differ from the production code. Also unit tests are not supposed to test the system in production, they should test units of code and that can be accomplished with this approach. As far as integration tests goes you'd have to use another approach.Patrik Hägnehttps://www.blogger.com/profile/09722697680972465898noreply@blogger.comtag:blogger.com,1999:blog-804807863784809914.post-6018556530268165142008-02-26T23:13:00.000+01:002008-02-26T23:13:00.000+01:00Yes Nikola, that's the idea exactly, I should prob...Yes Nikola, that's the idea exactly, I should probably update the examples to illustrate this point more clearly. I'm not a big fan of dependency injection frameworks, I think it makes the components a bit less intuitive to use, but that's my personal point of view.Patrik Hägnehttps://www.blogger.com/profile/09722697680972465898noreply@blogger.comtag:blogger.com,1999:blog-804807863784809914.post-35903777101249110342008-02-23T15:57:00.000+01:002008-02-23T15:57:00.000+01:00Very interesting idea, but one thing I don't get i...Very interesting idea, but one thing I don't get in the given example is why we needed to introduce new DI private constructor which accept object when it's value is not used in real code <BR/><BR/>Is the intention here to have a poor man dependency injection in default constructor (which would inject the default Foo "production" instance)?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-804807863784809914.post-2444416891020094002008-01-31T10:19:00.000+01:002008-01-31T10:19:00.000+01:00You have some interesting ideas here. I have thoug...You have some interesting ideas here. I have thought along those lines myself. Especially to be able to do testing on event handlers for the GUI.<BR/><BR/>However, there is one drawback with this approach. You will not be able to test your production code, just you debug code. <BR/><BR/>When you build for release you will not have your tests and be able to execute them on the the assemblies. <BR/><BR/>This will prevent you from be 100% certain that your production code will passes all your tests.Anonymousnoreply@blogger.com