MVC 3: How to learn how to test with NUnit, Ninject, and Moq?

If you are using the Ninject.MVC3 nuget package, then some of the article you linked that was causing confusion will not be required. That package has everything you need to start injecting your controllers which is probably the biggest pain point. Upon installing that package, it will create a NinjectMVC3.cs file in the App_Start folder, … Read more

Ninject: Registering an already created instance with Ninject?

You can use the ToConstant method which takes an already existing instance and registers it as singleton. var kernel = new StandardKernel(); kernel.Bind<MyClass>().ToConstant(myClassInstance); If you want to something more complex you can use the ToMethod (where you can use a Func to get your instance) combined with the InSingletonScope var kernel = new StandardKernel(); kernel.Bind<MyClass>().ToMethod(context … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)