Page 1 of 1

File structure for stubs & mocks

Posted: Sun Apr 05, 2009 1:09 pm
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

Re: File structure for stubs & mocks

Posted: Sun Apr 05, 2009 4:14 pm
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.

Re: File structure for stubs & mocks

Posted: Mon Jun 08, 2009 5:49 pm
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...

Re: File structure for stubs & mocks

Posted: Thu Jun 11, 2009 7:12 pm
by Jenk

Code: Select all

./mocks/