public static ResignAccountHandlerAutomation GetDebugAutomator()
        {
            var acceptedSenders = new List <MailboxAddress>
            {
                new MailboxAddress("luu nhat hong", "*****@*****.**"),
                new MailboxAddress("vo ya phuong khanh", "*****@*****.**"),
            };

            var automator = new ResignAccountHandlerAutomation()
            {
                SendReport = true,
                //SenderEmailSuffix = "@hdsaison.com.vn",
                ResignFolderName = "Test",
                AcceptedSenders  = acceptedSenders,
                Adapter          = new DbAdapter(GetDbPath()),
                EmailHandler     = new EmailHandler("luu.nhat-hong", "Dant@760119", true, "DoneResign"), //internet
                //EmailHandler = new EmailHandler("luu.nhat-hong", "Dant@760119"), //intranet
                Executioner     = new MockExecutioner(),                                                 //mock
                ReportCC        = new string[] { "*****@*****.**" },
                ReportReceiver  = new string[] { "*****@*****.**" },
                ReadEmailRetry  = 5,
                SendReportRetry = 5,
            };

            automator.EmailHandler.MoveToProcessedFolder = false;
            automator.Logic = new BussiessLogic(automator.Adapter, 10);
            return(automator);
        }
        public static ResignAccountHandlerAutomation GetAutomator(dynamic config)
        {
            var automator = new ResignAccountHandlerAutomation()
            {
                SendReport = config.SendReport,
                //SenderEmailSuffix = config.SenderEmailSuffix,
                ResignFolderName = config.ResignFolderName,
                AcceptedSenders  = TupleToAddressList(config.AcceptedResignSenders),
                Adapter          = new DbAdapter(GetDbPath()), //not configuarable
                EmailHandler     = config.EmailHandler,
                Executioner      = config.Executioner,
                ReportCC         = config.ReportCC,
                ReportReceiver   = config.ReportReceiver,
                SendReportRetry  = config.SendReportRetry,
                ReadEmailRetry   = config.ReadEmailRetry,
            };

            automator.EmailHandler.MoveToProcessedFolder = config.MoveToProcessedFolder;
            automator.EmailHandler.ProcessedFolderName   = config.ProcessedFolderName;

            automator.Logic = new BussiessLogic(automator.Adapter, config.DeleteAfter);
            return(automator);
        }