private void AddBindings() { //Mock<IProductsRepository> mock = new Mock<IProductsRepository>(); //mock.Setup(m => m.Products).Returns(new List<Product> // { // new Product { Name = "Football", Price = 25 }, // new Product { Name = "Surf board", Price = 179 }, // new Product { Name = "Running shoes", Price = 95 } // }.AsQueryable()); ninjectKernel.Bind<IProductsRepository>().To<EFProductRepository>(); ninjectKernel.Bind<IReports>().To<EFReports>(); EmailSettings emailSettings = new EmailSettings { WriteAsFile = bool.Parse(ConfigurationManager.AppSettings["Email.WriteAsFile"] ?? "false") }; ninjectKernel.Bind<IOrderProcessor>().To<EmailOrderProcessor>().WithConstructorArgument("settings", emailSettings); ninjectKernel.Bind<IAuthProvider>().To<FormsAuthProvider>(); }
public EmailOrderProcessor(EmailSettings settings) { emailSettings = settings; }