I am trying to test method in DAL of my web application with Fitnesse and FitSharp. I am having problems with reading app.config.
Getting error:
System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. ---> System.NullReferenceException:
Object reference not set to an instance of an object.
at ...DAL.get_ConnectionString()
This is in getter
get{
var result = ConfigurationManager.ConnectionStrings["CN1"].ConnectionString;
if (String.IsNullOrEmpty(result))
throw new NoNullAllowedException("Connection string does not exist");
return result;
}
Why ConfigurationManager is not initialized?
How to configure Fitnesse for testing DAL?
Thanks for any advice