File structure for stubs & mocks

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

File structure for stubs & mocks

Post by josh »

I was wondering what other people used in terms of file structure for storing stubs? Thanks ( short post ) I'm at a loss
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: File structure for stubs & mocks

Post by Chris Corbyn »

If they're generated (?) then don't store them in a separate file. If they're use-once but hand-coded, just put them above your test case, in the same file. If they're for repeated use across several tests, place them in your tests directory, under the same naming conventions as your tests.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: File structure for stubs & mocks

Post by alex.barylski »

Creating stubs is probably the biggest detriment to my unit testing as much as I would personally like too...

I started re-designing/re-factoring my framework/application and have so far successuflly moved to a completely IoC architecture. The complex views are what have me scared as the interface looks so slick when partials were injected into each other at construction time.

The complex view resembled something of a DSL for advanced view creation -- which is not likely using DI...
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Re: File structure for stubs & mocks

Post by Jenk »

Code: Select all

./mocks/
Post Reply