Since you said you're new I'm going to offer up some advice.
- The test seems to "expect" too many things that don't seem crucial to what it is you truly want to test. - I would suggest looking at the AAA syntax over the record/replay syntax (many find it easier to read and understand) If you post the whole test I'd be happy to comment further. On Thu, Oct 1, 2009 at 5:53 AM, Dave <[email protected]> wrote: > > Hi > > I'm really new to Rhino Mocks and am having some real trouble getting > my head around the following problem > > We are building an MVP site and are using Rhino to mock our View > implementation. I am currently trying to test that a login control > correctly attempts to validate a user. So I have set up my test as > follows > > using (mocks.Record()) > { > Expect.Call(Presenter.View.Username).Return("[email protected]"); > Expect.Call(Presenter.View.Password).Return("password1"); > Expect.Call(Presenter.ValidateUser()).Return(false); > } > using (mocks.Playback()) > { > //Playback > Presenter.SubmitLogin(); > } > > I get the following error > System.InvalidOperationException: Previous method > 'ILoginBoxView.get_Username();' requires a return value or an > exception to throw. > > But I don't really get what it's trying to tell me. > > in psuedo-code, I'm trying to say I expect the View to call Username > and Password and return the specified values and I expect that > Presenter.ValidateUser() will be called and I want it to return false. > > Can anyone help me clear up what's I'm doing wrong here? > > Thanks > > Dave > > > > -- Tim Barcz Microsoft ASPInsider http://timbarcz.devlicio.us http://www.twitter.com/timbarcz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rhinomocks?hl=en -~----------~----~----~----~------~----~------~--~---
