Re: Unit Testing Model-View-Presenter

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I am using TDD, along with mock views attached to the View interface to
attempt to unit test the UI. The problem I am having is when using the
InitView() of the presenter, normally I would be retrieving data from
NHibernate when InitView is called.

I thought that in fact your Model would be dealing with nHibernate?
Which means you would need to Mock it as well. And in your case, a call
to the Mocked model object should return an object that has been
constructed from nHibernate.

Therein lies the problem, I can't seem to figure out how to properly
attach to the presenters from my unittest code, and then call InitView
without my production presenters actually connecting to the DB and
retirieving data.

Have you got a high level example?

Could be I am not exactly understanding the approach...

SN

.



Relevant Pages

  • Re: Unit Testing Model-View-Presenter
    ... I cannot find NHibernate in the book anyway. ... But you mentioned DAO. ... NHibernate when InitView is called. ... attach to the presenters from my unittest code, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Unit Testing Model-View-Presenter
    ... I have not even tried to start implementing Dao classes yet, ... unit test to perform functionality in other parts of your code. ... I cannot find NHibernate in the book anyway. ... NHibernate when InitView is called. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Unit Testing Model-View-Presenter
    ... attach to the presenters from my unittest code, and then call InitView ... retirieving data. ...
    (microsoft.public.dotnet.languages.csharp)