121 reputation
4
bio website careers.stackoverflow.com/…
location Manchester, UK
age 26
visits member for 1 year, 5 months
seen Jun 21 at 12:17

Senior Developer at Building Blocks (UK) Ltd. C#, ASP.NET MVC.

SDL Tridion 2011 Certified Developer.

http://www.building-blocks.com/thinking/author/aplant


Feb
7
comment Why creativity is consider a bad practice by architects?
Have you tried asking these senior devs why they don't think your solution is better?
Jan
29
revised Unit testing methods with logical dependencies on other classes
added 1 characters in body
Jan
29
comment Unit testing methods with logical dependencies on other classes
@CodesInChaos I had considered that, but QueryBuilder has methods with logic sufficiently complex that I would like to test it in isolation, which means that not mocking it undermines the usefulness of testing SearchService, no?
Jan
29
comment Unit testing methods with logical dependencies on other classes
This is why a factory seems more appropriate - inject the factory and let the method instantiate the query builder. But it also seems overengineered.
Jan
29
revised Unit testing methods with logical dependencies on other classes
added 173 characters in body
Jan
29
comment Unit testing methods with logical dependencies on other classes
That's all fine; except, as I said, the logical lifetime of the QueryBuilder is within the method - it's instantiated within the method, its state is manipulated with in the method and it is destructed within the method. Use of DI (be it parameter or constructor injection) would imply a query builder per search service instance, which does not make sense given the functionality of the query builder.
Jan
29
revised Unit testing methods with logical dependencies on other classes
deleted 50 characters in body
Jan
29
asked Unit testing methods with logical dependencies on other classes
Mar
21
awarded  Student
Mar
21
awarded  Editor
Mar
21
revised Designing models for a generic service layer
added 12 characters in body
Mar
21
asked Designing models for a generic service layer
Feb
24
awarded  Autobiographer
Jan
27
awarded  Supporter