I recognize its not traditional, and had misgivings when I started.
It just worked well enough that I just kept at it :).
The reason I want to do this is that it lets me test certain things
(routing, View rendering) before their dependencies are ready. To do
proper integration testing additional components need to be
implemented first, forcing me to implement the repository first. I
avoid implementing the repository first so its requirements can be
fleshed out.
This is for things where I haven't found a good way to test in
isolation. For instance testing routing in isolation feels very
unnatural to me (if you have routing tests that you like, I'd be happy
to look at them). Test setup is complicated in that I am specifying
things that have nothing to do with the layer I'm testing. Views seem
even harder to test... How do you verify a view has link to some other
controller's actions? This is the cleanest way I've found to test it.
Testing controllers in isolation is easy, verifying the right model
is passed to the view again is easy, but I find this half-integration
testing necessary to test what happens after that. I'd be happy to
consider other approaches.
On Jul 19, 9:44 am, Sean Chambers <
schamber...@gmail.com> wrote:
> IMO, that is out of scope of what an integration test should be doing (at least in the context of ninject). What you are doing is much higher level as functional/smoke tests but you are still wanting to have a large degree of integration setup which isn't really possible with functional testing (again, in the context of ninject).
>
> You should test each portion in an integration test with the kernel, then have a different set of tests that are invoked using watin/selenium with everything matching as close to production as possible. This gets rid of inconsistencies when you get to production.
>
> I'm sure you could get what your trying to do to work, but I personally don't see he value and your needing to add constructs to ninject to expose seams that you shouldn't actually need.
>
> Is there any reason why you are trying to swap out all this things in the kernel when invoking your watin tests? All of our selenium tests run against a SQL database, test web services and a test website if applicable.
>
> Make sense?
>
> Sean
>