public static void TearDown() { if (_unityProvider != null) { _unityProvider.Dispose(); _unityProvider = null; } }
public static void Setup(DBLayer dbLayer, string smtpHost, int dbRetries, int dbSleepSeconds) { #region create daos IUserDao userDAO = new UserDao(dbLayer); IQueueDao queueDao = new QueueDao(dbLayer); ICommonDao commonDao = new CommonDao(dbLayer); ICampaignDao campaignDAO = new CampaignDao(dbLayer); IPageDao pageDAO = new PageDao(dbLayer); IPageElementDao pageElementDAO = new PageElementDao(dbLayer); IPredefinedQuestionDao predefinedQuestionDAO = new PredefinedQuestionDao(dbLayer); IQuestionnaireDao questionnaireDAO = new QuestionnaireDao(dbLayer); IResponseDao responseDAO = new ResponseDao(dbLayer); IReportingDao reportingDAO = new ReportingDao(dbLayer); IStatisticsDao statisticsDAO = new StatisticsDao(dbLayer); IOmnitureDao omnitureDAO = new OmnitureDao(dbLayer); IMasterReportDao masterDAO = new MasterReportDao(dbLayer); IEmailDao emailDAO = new EmailDao(dbLayer); IPrivacyDataSectionDao privacyDao = new PrivacyDataSectionDao(dbLayer); IPersonalDataSectionDao personalDao = new PersonalDataSectionDao(dbLayer); IMailDao mailDao = new MailDao(dbLayer); IMailer mailer = new Mailer(smtpHost); IHpFramesDao hpFramesDao = new HpFramesDao(dbLayer); #endregion IDictionary<Type, object> typeMap = new Dictionary<Type, object>(); #region init map typeMap[typeof(IUserDao)] = userDAO; typeMap[typeof(IQueueDao)] = queueDao; typeMap[typeof(ICommonDao)] = commonDao; typeMap[typeof(ICampaignDao)] = campaignDAO; typeMap[typeof(IPageDao)] = pageDAO; typeMap[typeof(IPageElementDao)] = pageElementDAO; typeMap[typeof(IPredefinedQuestionDao)] = predefinedQuestionDAO; typeMap[typeof(IQuestionnaireDao)] = questionnaireDAO; typeMap[typeof(IResponseDao)] = responseDAO; typeMap[typeof(IReportingDao)] = reportingDAO; typeMap[typeof(IStatisticsDao)] = statisticsDAO; typeMap[typeof(IOmnitureDao)] = omnitureDAO; typeMap[typeof(IMasterReportDao)] = masterDAO; typeMap[typeof(IEmailDao)] = emailDAO; typeMap[typeof(IPrivacyDataSectionDao)] = privacyDao; typeMap[typeof(IPersonalDataSectionDao)] = personalDao; typeMap[typeof(IMailer)] = mailer; typeMap[typeof(IMailDao)] = mailDao; typeMap[typeof(IHpFramesDao)] = hpFramesDao; #endregion if (_unityProvider != null) { _unityProvider.Dispose(); } _unityProvider = new UnityProvider(typeMap, dbRetries, dbSleepSeconds); Register(_unityProvider); SetupComponents(); SetupValidators(); }
private static void Register(UnityProvider provider) { AdminRegistry.Register(provider); FormRegistry.Register(provider); ReportingRegistry.Register(provider); StatisticsRegistry.Register(provider); MailRegistry.Register(provider); }