These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: NHibernate/Nunit - dialect not set
PostPosted: Wed Jul 12, 2006 12:49 pm 
Newbie

Joined: Fri Jun 30, 2006 8:37 am
Posts: 8
Hi,

I am an Nhibernate newbie and wondered if anyone can answer this question.

I have an NHibernate solution that contains both a web project and a windows form project. I have set the appropriate Nhinernate settings in each of the project's appropriate configuration files (i.e. App.config and web.config) and Nhibernate works fine.

I now wish to extend the solution to include an Nunit test project. (Project type Class library).

When attempting to run the Nunit tests the tests fall over at the first hurdle with the message "The dialect was not set".

I assume the reason for this failure is because there is no configuration file within the Nunit class library project.

Is there any easy way to dynamically load the Nhibernate configuration settings from either the app.config or web.config files of the other projects within the solution.

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 12, 2006 7:35 pm 
Regular
Regular

Joined: Wed Jun 21, 2006 3:13 pm
Posts: 110
Open your .nunit file and add a ConfigFile attribute to the <config tag:

Code:
  <Config name="Default" configfile="src\StateAuditor\App.config" binpathtype="Auto">


You can also access this from the NUnit GUI under the project properties. However, there seems to be a bug in the UI where it won't allow you to reference a file outside of the current directory.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 13, 2006 4:28 am 
Newbie

Joined: Fri Jun 30, 2006 8:37 am
Posts: 8
Ben,

Thanks for the response. It worked a treat!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.