I think your right. I possibly should mock most of these database calls. That does make sense. > I didn't quite get that, you're mocking sending of the email? What's the> > point of that? It means I do not have to rely on SMTP being installed and configured on the machine running the tests. > Most TDD purists will tell you that you should always mock the database;> > there's no real need to test that. Then how do you test the database schema?I am using NHibernate to generate the db but after version 1 it will be all manual changes.Surely the schema needs tested as well. [EMAIL PROTECTED]
> Date: Fri, 4 Jan 2008 11:18:11 -0500> From: [EMAIL PROTECTED]> Subject: Re: > [ADVANCED-DOTNET] Unwiedly unit test> To: > ADVANCED-DOTNET@DISCUSS.DEVELOP.COM> > On Fri, 4 Jan 2008 16:17:20 +0000, > Paul Cowan <[EMAIL PROTECTED]> wrote:> > >I have to create the plan each > time.> >I have to assign contacts to the plan.> >They have to request sign > off in order to be able to sign it off.I raise> exceptions if any of the > above is not the case if a sign off is requested> and all is not good.> >> > > Are/do you also want to test the creation of a plan, assignment of contacs> > to a plan? If you just want to test sign-off then you'll likely want to> mock > that.> > >I also want to create and delete the plan from the database on each > unit> test.> >> > Most TDD purists will tell you that you should always mock > the database;> there's no real need to test that.> > >Emails get sent out > etc. which I am able to mock.> > I didn't quite get that, you're mocking > sending of the email? What's the> point of that? Will the outcome of your > test be the same without the call> to _mockEmailSender.Send()? I.e. are there > any side-effects to that> call? If not, you're only testing the mock...> > > ===================================> This list is hosted by DevelopMentorĀ® > http://www.develop.com> > View archives and manage your subscription(s) at > http://discuss.develop.com _________________________________________________________________ Get Hotmail on your mobile, text MSN to 63463! http://mobile.uk.msn.com/pc/mail.aspx =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com