Click here to Skip to main content
14,447,974 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: CodeDom users, what's your opinion? Pin
Nelek26-Nov-19 23:21
protectorNelek26-Nov-19 23:21 
GeneralRe: CodeDom users, what's your opinion? Pin
honey the codewitch26-Nov-19 23:22
mvahoney the codewitch26-Nov-19 23:22 
GeneralRe: CodeDom users, what's your opinion? Pin
Nelek27-Nov-19 1:11
protectorNelek27-Nov-19 1:11 
GeneralRe: CodeDom users, what's your opinion? Pin
honey the codewitch27-Nov-19 1:12
mvahoney the codewitch27-Nov-19 1:12 
GeneralRe: CodeDom users, what's your opinion? Pin
Nelek27-Nov-19 12:26
protectorNelek27-Nov-19 12:26 
GeneralRe: CodeDom users, what's your opinion? Pin
honey the codewitch27-Nov-19 12:28
mvahoney the codewitch27-Nov-19 12:28 
GeneralRe: CodeDom users, what's your opinion? Pin
Nelek27-Nov-19 20:03
protectorNelek27-Nov-19 20:03 
QuestionUnit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
MSBassSinger26-Nov-19 7:05
professionalMSBassSinger26-Nov-19 7:05 
Please, no "mocking" of the question or questioner. Smile | :)

At several places where I have worked, there were those who made a common practice of using mock data in their unit tests, and those who made a practice of integrating a test database into their unit tests.

The former draw a clear distinction between unit testing and integrated testing. Where there are multi-tiered objects (e.g. controller, services, repositories, etc.) each level gets tested. The theory is that each object is tested independently, so however and by whatever it is used, it will succeed. Integrated testing, with an actual database, is the next step of testing.

The latter see what is being tested as a connected group of systems, so to them integrated testing is part of the process of unit testing. The theory seems to go: Test the outermost connection point (the exposed Web API method) which in turn tests the objects and methods down the stack, as well as the connections between them. That includes using a test database (and test services for 3rd party APIs) so that part of the connected system is tested. The end result they seek is that when the outermost connection point is used, it and everything below it has been tested.

I see a good reason to use either approach, depending on what I am testing. I do have preferences, but I am interested in what this community thinks about using mock data?

Thank you in advance.
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Eddy Vluggen26-Nov-19 7:32
professionalEddy Vluggen26-Nov-19 7:32 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Maximilien26-Nov-19 7:35
MemberMaximilien26-Nov-19 7:35 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Sander Rossel26-Nov-19 10:32
professionalSander Rossel26-Nov-19 10:32 
GeneralRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Rick York26-Nov-19 11:29
mveRick York26-Nov-19 11:29 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Marc Clifton26-Nov-19 13:11
communityengineerMarc Clifton26-Nov-19 13:11 
GeneralRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Dan Neely27-Nov-19 4:22
MemberDan Neely27-Nov-19 4:22 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
GuyThiebaut26-Nov-19 21:47
professionalGuyThiebaut26-Nov-19 21:47 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
RichardS26-Nov-19 22:02
MemberRichardS26-Nov-19 22:02 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Tomas Takac26-Nov-19 22:26
MemberTomas Takac26-Nov-19 22:26 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Carl_Sharman26-Nov-19 22:41
MemberCarl_Sharman26-Nov-19 22:41 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Stuart Dootson26-Nov-19 23:58
professionalStuart Dootson26-Nov-19 23:58 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
#realJSOP27-Nov-19 2:11
mva#realJSOP27-Nov-19 2:11 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Ed K27-Nov-19 3:31
MemberEd K27-Nov-19 3:31 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
davecasdf27-Nov-19 5:36
Memberdavecasdf27-Nov-19 5:36 
GeneralRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
MSBassSinger27-Nov-19 7:42
professionalMSBassSinger27-Nov-19 7:42 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Bruce Patin27-Nov-19 7:58
MemberBruce Patin27-Nov-19 7:58 
GeneralRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
MSBassSinger27-Nov-19 8:08
professionalMSBassSinger27-Nov-19 8:08 

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.