Re: Unit Testing Model-View-Presenter



I see, this is what I was leaning towards.

Even while using NHibernate, I guess you still need a DataLayer
assembly to return specific sets of data depending on the type of
request.

I guess this is where the DAO's come into play.

Thank you for everyones comments!

Sean

Joanna Carter [TeamB] wrote:
"Sean Chambers" <dkode8@xxxxxxxxx> a écrit dans le message de news:
1160102195.049625.272700@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

| I guess what I'm looking for here, is what is the proper way to supply
| my presenter with a mock object, so that I can effectively test MVP.
| >From all the books I've read, they always stress not to delve to far
| into the chain while unit testing.

As with all well-designed OO software, separation of concerns is the key
here.

Your "data" should only be accessible from a separate "layer", so you need
to design an interface or abstract class that encapsulates the concept of
data access and then design "real" and "mock" layers that can be
instantiated, depending on whether you are testing or using the classes.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer

.