Click here to Skip to main content
15,898,134 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Giorgi Dalakishvili19-Dec-08 8:19
mentorGiorgi Dalakishvili19-Dec-08 8:19 
AnswerRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Mark Churchill22-Dec-08 18:42
Mark Churchill22-Dec-08 18:42 
AnswerRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
CodingYoshi25-Dec-08 21:03
CodingYoshi25-Dec-08 21:03 
AnswerRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? [modified] Pin
Jon Rista6-Jan-09 9:01
Jon Rista6-Jan-09 9:01 
GeneralRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Leftyfarrell6-Jan-09 13:10
Leftyfarrell6-Jan-09 13:10 
GeneralRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Jon Rista6-Jan-09 13:36
Jon Rista6-Jan-09 13:36 
QuestionRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Leftyfarrell6-Jan-09 14:13
Leftyfarrell6-Jan-09 14:13 
AnswerRe: Architecture that supports Unit Testing - Is there such a thing as Too Many Interfaces? Pin
Jon Rista6-Jan-09 17:46
Jon Rista6-Jan-09 17:46 
Unit testing and statics are always a rich topic of discussion. Wink | ;) Ultimately, what it boils down to is whether you think testing the static Globalization type is acceptable when your actually unit testing something else. If you are unit testing UserMapping, and mocking GlobalizationAdapter, your also interaction testing Globalization. At some point, you need to interaction test, to make sure that when A uses B, the interaction of the two behave like you would expect. Sometimes you can achieve this with a mock...sometimes you need to test the interaction of two real objects. Testing has a variety of forms: unit testing, interaction testing, acceptance testing, build verification testing, etc. Unit tests will only take you so far, and you can plug the holes and double up by performing other kinds of testing.

In the case of your static Globalization class, it sounds like its a pretty simple type that acts as a lazy-loaded lookup? If its basically just a facade around a dictionary and some loading logic, I would not bother mocking it away, and just include it with your UserMapping unit tests. If Globalization is a richer class, and provides a variety of globalization services, it might be better to mock it away. You would want to unit test Globalization in isolation as well, to make sure you cover code that wouldn't be covered by interaction testing.

If you do indeed need to mock away static types, there is one product that will let you do it: TypeMock Isolator. TypeMock's Isolator lets you mock absolutely anything, statics included. Its a pretty unique mocking framework that really helps you get the job done when nothing else will. Couple caveats: 1) its not free, and 2) it requires that all testing processes be spawned from its isolator root process that enables all the advanced call interception and whatnot.
QuestionDownloading URLs with Python ?? Pin
Fuat Mx13-Dec-08 7:25
Fuat Mx13-Dec-08 7:25 
QuestionTDD, Mocks, and Isolating Legacy Application Components? Pin
Philip Laureano8-Dec-08 21:08
Philip Laureano8-Dec-08 21:08 
AnswerRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
led mike9-Dec-08 4:25
led mike9-Dec-08 4:25 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Urs Enzler16-Dec-08 8:49
Urs Enzler16-Dec-08 8:49 
AnswerRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Mark Churchill13-Dec-08 2:35
Mark Churchill13-Dec-08 2:35 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Philip Laureano13-Dec-08 3:24
Philip Laureano13-Dec-08 3:24 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Pete O'Hanlon16-Dec-08 10:07
mvePete O'Hanlon16-Dec-08 10:07 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Philip Laureano16-Dec-08 13:48
Philip Laureano16-Dec-08 13:48 
AnswerRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Jon Rista6-Jan-09 6:37
Jon Rista6-Jan-09 6:37 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Pete O'Hanlon6-Jan-09 8:28
mvePete O'Hanlon6-Jan-09 8:28 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Jon Rista6-Jan-09 9:11
Jon Rista6-Jan-09 9:11 
QuestionHow this can be done in Atomic way? Pin
paresh_joe8-Dec-08 19:27
paresh_joe8-Dec-08 19:27 
GeneralRe: How this can be done in Atomic way? Pin
led mike9-Dec-08 4:30
led mike9-Dec-08 4:30 
AnswerRe: How this can be done in Atomic way? Pin
CodingYoshi10-Dec-08 3:44
CodingYoshi10-Dec-08 3:44 
GeneralRe: How this can be done in Atomic way? Pin
paresh_joe10-Dec-08 23:36
paresh_joe10-Dec-08 23:36 
GeneralRe: How this can be done in Atomic way? Pin
CodingYoshi11-Dec-08 3:34
CodingYoshi11-Dec-08 3:34 
AnswerRe: How this can be done in Atomic way? Pin
samdevloper8-Mar-09 19:18
samdevloper8-Mar-09 19:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.