Search   

Thursday, September 09, 2010

Support » Support Forum

Register  Login

 Menu  
 
    

 Welcome!  
 


Welcome to the NDO support forum!

kreis.gif Please register/login at the site if you want to post a thread. We sometimes copy support mails of common interest to the forum. They appear with anonymous sender.
kreis.gif Please post your messages in English language if possible. You can do your posts also in German, we will translate your post and our answer so that all users of the forum can read your posts.
kreis.gif The forum software requires that javascript is enabled.
kreis.gif Please do not insert licence information or licence keys in forum posts.
kreis.gif If you know a good answer to a post of another user, feel free to reply!
kreis.gif The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.

   Print   

      
 NDO Support Forum  
 
SearchForum Home
  NDO-Forum postings in english please, if possible.  Developing with NDO  NUnit...
 NUnit
 
 1/16/2007 1:41:24 PM
FalkW
6 posts


NUnit
How can testing with nunit? When I run a Assembly with NUnit the I have a NDOException with NDOMapping.xml does't exist. NUnit run the test in a ShadowCopyCache.
 1/16/2007 2:12:12 PM
Mirko
109 posts
5th


Re: NUnit

Hi Falk,

per default NDO searches the NDOMapping.xml in the directory where the executable resides. In case of the shadow copy this is the shadow copy directory which doesn't contain the NDOMapping.xml.

The workaround is to provide the mapping file path to the PersistenceManager constructor. I suggest writing a factory class with a static method:

public class PmFactory
{
    public static PersistenceManager Create()
    {
        return new PersistenceManager("PathToYourMappingFile");
    }
}

In your tests use
PersistenceManager pm = PmFactory.Create();

If you make a change to the PmFactory.Create method, it will apply to all tests.

I suggest using the TestDriven.NET add-in for visual studio. With this add-in you can run tests from inside the VS editor and seeing the result in the output pane.

I suggest also to write a little test runner program, which references your test dll and is able to run a single test for debugging purposes.

Best Regards:
Mirko

  NDO-Forum postings in english please, if possible.  Developing with NDO  NUnit...
  SearchSearch  Forum HomeForum Home