New Posts New Posts RSS Feed: Unit Test throws exception
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Unit Test throws exception

 Post Reply Post Reply
Author
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Topic: Unit Test throws exception
    Posted: 03-Jan-2008 at 10:04am
While using Visual Studio 2008 and DevForce 3.5.5.1 Beta, I ran into an issue with ‘PersistenceManager.DefaultManager’ when I tried to run unit tests. If I run the application I get the correct value in the text box.  If I try to run the Unit Test “PersistanceManagerInUnitTests /DD.Tests.cs”, I get the following exception:  'PersistenceManager.DefaultManager' threw an exception of type 'IdeaBlade.Util.IdeaBladeException'.

base      {"Unable to obtain a valid configuration file on <ComputeName>\n\nProbing path: \n1) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\CQConverter.exe.config - not found\n2) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.exe.config - not found\n3) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\diffmerge.exe.config - not found\n4) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\MSTest.exe.config - not found\n5) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\TF.exe.config - not found\n6) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\TfsBuild.exe.config - not found\n7) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\TFSFieldMapping.exe.config - not found\n8) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\vsdiag_regwcf.exe.config - not found\n9) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\VSSConverter.exe.config - not found\n10) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\VSTestHost.exe.config - not found\n11) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\VSTST-FileConverter.exe.config - not found\n12) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\IdeaBlade.ibconfig - not found\n13) Design-time execution detected - Will not probe for app.config or IdeaBlade.ibconfig in AppHelper\n14) IdeaBlade.ibconfig fallthru - Default IdeaBlade.ibconfig used\n15) Logging file: \n"}System.Exception {IdeaBlade.Util.IdeaBladeException}

Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Posted: 03-Jan-2008 at 10:07am
We ran into the very same issue when we started running our own Unit Tests on our V4 product (which runs only under VS2008).

Here’s the code we’re using – you’ll find an Initialize() method in all our V4 Unit Tests.

 

    [TestInitialize]

    public void Initialize() {

      // With the VS2008 Test framework the AppDomain and base directory will be pointing

      // to the common/ide directory and config file probing will fail if you're using the AppHelper. 

      // Here’s a workaround:

      IdeaBladeConfig.ConfigFileAssembly = System.Reflection.Assembly.Load("AppHelper");

    }

 

Note that the initialization isn’t strictly required in [TestInitialize], that’s just what we use.

 

 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down