Fitnesse と FitSharp を使用して、Web アプリケーションの DAL でメソッドをテストしようとしています。app.config の読み取りに問題があります。
取得エラー:
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()
これはゲッターにあります
get{
var result = ConfigurationManager.ConnectionStrings["CN1"].ConnectionString;
if (String.IsNullOrEmpty(result))
throw new NoNullAllowedException("Connection string does not exist");
return result;
}
ConfigurationManager が初期化されないのはなぜですか?
DAL をテストするための Fitnesse の設定方法
アドバイスをありがとう