Fitnesse Slim query test fails while trying to access linq datacontext
I wrote a query that gets a list of objects using linq. The code executes fine in the project, but fails when I try to access it from the fitnesse project. base(global::System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString, mappingSource) I guess it has something to do with the c开发者_如何学Connection string, but I don't know how to specify the connection string separately for the fitnesse project. Both project and fitnesse project are part of the same solution. Any ideas? Thanks, Jenny
You need to specify where to find the app config file:
http://www.syterra.com/Slim/AppConfigFiles.html
Thanks, I already tried adding a suite.config and then app config to my c:\fitnesse folder - where the .jar file is.
I added -c option c:\Fitnesse\suite.config to the command section on the test page. Here's the suite.config file: c:\fitnesse\myapp.config ^.svn$
Here's the myapp.config file:
The test still fails here:
public MyDataContext() : base(global::System.Configuration.ConfigurationManager.ConnectionStrings["mycon"].ConnectionString, mappingSource) { OnCreated(); }
精彩评论