public SafevaultService() { AppConfig app = new AppConfig(); Log.Instance = new LogManager(app); Logger = Log.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); Unity = new Unity.Unity(); Unity.RegisterInstance <IConfig, AppConfig>(app); Unity.Register <ICommandProcessor, CommandProcessor>(); Unity.Register <BanList.BanList, BanList.BanList>(); Unity.Register <TokenList, TokenList>(); Unity.Register <X509Store, X509Store>(); Unity.Register <IAuthenticate, Authentication>(); Unity.Register <ISendMail, SendMail>(); Unity.Register <Notification.EmailNotification, Notification.EmailNotification>(); }
public void SetUp() { _location = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); Environment.CurrentDirectory = _location; var config = new AppConfig($"data/app.config"); Unity = new Unity.Unity(); Unity.RegisterInstance <IConfig, AppConfig>(config); Unity.Register <ILogManager, LogManager>(); Unity.Register <ICommandProcessor, CommandProcessor>(); Unity.Register <IAuthenticate, Authentication>(); Unity.Register <BanList.BanList, BanList.BanList>(); Unity.Register <TokenList, TokenList>(); Unity.Register <X509Store, X509Store>(); Unity.Register <Notification.EmailNotification, Notification.EmailNotification>(); Unity.Register <ISendMail, SendMail>(); Log.Instance = Unity.Resolve <ILogManager>(); Unity.BuildUp(typeof(CommandTest), this); }