2016-09-27 7 views
0

ユニットテスト用にStandardKernelをセットアップしようとしていますが、この部分のテストを実行するとSystemNotImplementedExceptionが発生します。System.NotImplementedException Ninject Unit Test

[TestMethod] 
    public void MyTestMethod() 
    { 
     var kernel = new StandardKernel(); 
     kernel.Bind<IView1>().To<View1>(); 
     kernel.Bind<IViewModel1>().To<ViewModel1>(); 
    } 

誰でも問題の可能性はありますか?

System.NotImplementedException was unhandled by user code 
    HResult=-2147467263 
    Message=The method or operation is not implemented. 
    Source=Ninject 
    StackTrace: 
     at Ninject.Syntax.BindingRoot.Bind[T]() 
     at Ninject.KernelBase..ctor(IComponentContainer components, INinjectSettings settings, INinjectModule[] modules) 
     at Ninject.KernelBase..ctor(INinjectModule[] modules) 
     at Ninject.StandardKernel..ctor(INinjectModule[] modules) 
     at TESTMETHOD in UNIT TEST LOCATION 
    InnerException: 

答えて

1

問題はユニットテストプロジェクトにインストールされたNinjectのタイプでした。アプリケーションはポータブルなので、必要なのは標準のninjectの代わりにportable Ninjectを参照することだけでした。

関連する問題