Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. using AutoMapper;
  2. using Ninject.Modules;
  3. using Profile.BL.Interfaces;
  4. using Profile.BL.Providers;
  5. using Profile.DAL.Context;
  6. using Profile.UI.Mappers;
  7.  
  8. namespace Profile.UnitTests
  9. {
  10. public class NinjectTestingModule : NinjectModule
  11. {
  12. public override void Load()
  13. {
  14. // providers binding
  15. Bind<IUsersProvider>().To<UsersProvider>();
  16. Bind<ITraineeProvider>().To<TraineeProvider>();
  17. Bind<IProfileProvider>().To<ProfileProvider>();
  18. Bind<ISoftSkillProvider>().To<SoftSkillProvider>();
  19. Bind<IMainSkillProvider>().To<MainSkillProvider>();
  20. Bind<ICourseProvider>().To<CourseProvider>();
  21. Bind<IUniversityProvider>().To<UniversityProvider>();
  22. Bind<ILanguageProvider>().To<LanguageProvider>();
  23. Bind<ILinkProvider>().To<LinkProvider>();
  24. Bind<IJiraProvider>().To<JiraProvider>();
  25. Bind<IFileProvider>().To<FileProvider>();
  26. Bind<IProjectProvider>().To<ProjectProvider>();
  27. Bind<IMentorProvider>().To<MentorProvider>();
  28. Bind<IMentorReviewProvider>().To<MentorReviewProvider>();
  29. Bind<IScrumReviewProvider>().To<ScrumReviewProvider>();
  30. Bind<IScrumMasterProvider>().To<ScrumMasterProvider>();
  31. Bind<ITraineeReviewProvider>().To<TraineeReviewProvider>();
  32.  
  33. // context binding
  34. Bind<IProfileContext>().To<ProfileContext>().WithConstructorArgument("dbConnectionString", "ProfileDB");
  35.  
  36. // mappers binding
  37. Bind<LanguageMapper>().ToSelf().InSingletonScope();
  38. Bind<SkillMapper>().ToSelf().InSingletonScope();
  39. Bind<EducationMapper>().ToSelf().InSingletonScope();
  40. Bind<ProfileMapper>().ToSelf().InSingletonScope();
  41. Bind<ProjectMapper>().ToSelf().InSingletonScope();
  42. Bind<MentorMapper>().ToSelf().InSingletonScope();
  43. Bind<MentorReviewMapper>().ToSelf().InSingletonScope();
  44. Bind<ScrumReviewMapper>().ToSelf().InSingletonScope();
  45. Bind<TraineeReviewMapper>().ToSelf().InSingletonScope();
  46.  
  47. // AutoMapperConfiguration binding
  48. Bind<IMapper>().ToMethod(AutoMapperCreator.GetMapper).InSingletonScope();
  49.  
  50. // jira rest client binding
  51. //string jiraUrl = System.Configuration.ConfigurationManager.AppSettings["JiraUrl"];
  52. //string jiraUserName = System.Configuration.ConfigurationManager.AppSettings["JiraUserName"];
  53. //string jiraPassword = System.Configuration.ConfigurationManager.AppSettings["JiraPassword"];
  54.  
  55. //Bind<IJiraClient>().To<JiraClient>()
  56. // .WithConstructorArgument("jiraUrl", jiraUrl)
  57. // .WithConstructorArgument("jiraUserName", jiraUserName)
  58. // .WithConstructorArgument("jiraPassword", jiraPassword);
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement