New Posts New Posts RSS Feed: [SOLVED] How to Unit Test DevForce EF
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

[SOLVED] How to Unit Test DevForce EF

 Post Reply Post Reply
Author
philpastor View Drop Down
Newbie
Newbie
Avatar

Joined: 09-Apr-2008
Location: United States
Posts: 9
Post Options Post Options   Quote philpastor Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] How to Unit Test DevForce EF
    Posted: 29-Apr-2008 at 12:31pm
ok, I've been struggling with this for a few hours now, and I give up.
 
I am attempting to create unit tests for the Domain Model in VS 2008. I have an app.config file in my test project, and the ideablade section is in there. When I run the test, Visual Studio's testing framework deploys the app config file as "TestProject1.dll.config" (which is expected), along with all of the ssdl, csdl, msl files. When I attempt to access the EntityManager, I get the following error:
 
Class Initialization method TestProject1.TestDevForce.MyClassInitialize threw exception. IdeaBlade.Util.v4.IdeaBladeException:  IdeaBlade.Util.v4.IdeaBladeException: Unable to obtain a valid configuration file on L3G1514.
Possible cause: No IdeaBladeSection in config file (File: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\CQConverter.exe.config)
Probing path:
1) File: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\CQConverter.exe.config - found but failed to load: No IdeaBladeSection in config file
2) File: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe.config - found but failed to load: No IdeaBladeSection in config file
3) File: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\diffmerge.exe.config - found but failed to load: No IdeaBladeSection in config file
4) File: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe.config - found but failed to load: No IdeaBladeSection in config file
5) File: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\TF.exe.config - found but failed to load: No IdeaBladeSection in config file
6) File: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\TfsBuild.exe.config - found but failed to load: No IdeaBladeSection in config file
7) File: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\TFSFieldMapping.exe.config - found but failed to load: No IdeaBladeSection in config file
8) File: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\vsdiag_regwcf.exe.config - found but failed to load: No IdeaBladeSection in config file
9) File: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VSSConverter.exe.config - found but failed to load: No IdeaBladeSection in config file
10) File: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VSTestHost.exe.config - found but failed to load: No IdeaBladeSection in config file
11) File: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VSTST-FileConverter.exe.config - found but failed to load: No IdeaBladeSection in config file
12) Design-time execution detected - Will not probe for app.config in AppHelper
13) app.config fallthru - Default app.config used
14) Logging file:
.
 
 
Any thoughts?


Edited by philpastor - 30-Apr-2008 at 10:23am
Back to Top
danielp37 View Drop Down
Newbie
Newbie


Joined: 18-Mar-2008
Location: United States
Posts: 29
Post Options Post Options   Quote danielp37 Quote  Post ReplyReply Direct Link To This Post Posted: 29-Apr-2008 at 10:00pm
I had the same problem and found the solution for me here: http://www.ideablade.com/forum/forum_posts.asp?TID=711

I also found that I needed to add the csdl, msl and ssdl as additional files to deploy in the testrunconfig deployment.
Back to Top
philpastor View Drop Down
Newbie
Newbie
Avatar

Joined: 09-Apr-2008
Location: United States
Posts: 9
Post Options Post Options   Quote philpastor Quote  Post ReplyReply Direct Link To This Post Posted: 30-Apr-2008 at 5:26am
Daniel,
 
Thanks for the reply.
 
For anyone else looking for the solution, here is what I did:
Added a reference to IdeaBlade.Util.v4
Added a reference to System.Configuration
Added the following line to the ClassInitialize method of the test class:

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

...and yes, you also need to add the msl, csdl, ssdl files to the deployment tab of the testrunconfig.
 
Phil
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down