public static int Main(string[] args) { CommandLineApplication commandLineApplication = new CommandLineApplication(false); commandLineApplication.Name = "MxTlsTester"; commandLineApplication.HelpOption("-? | -h | --help"); commandLineApplication.OnExecute(async() => { AppDomain.CurrentDomain.ProcessExit += CurrentDomainOnProcessExit; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; _cancellationTokenSource = new CancellationTokenSource(); IMxSecurityTesterProcessor mxSecurityTesterProcessor = MxSecurityTesterFactory.CreateMxSecurityTesterProcessor(); await mxSecurityTesterProcessor.Process(_cancellationTokenSource.Token); return(0); }); return(commandLineApplication.Execute(args)); }
public MxSecurityTesterProcessorRunner(IScheduler scheduler, IMxSecurityTesterProcessor mxSecurityTesterProcessor, IMxSecurityTesterConfig mxSecurityTesterConfig) { _scheduler = scheduler; _mxSecurityTesterProcessor = mxSecurityTesterProcessor; _mxSecurityTesterConfig = mxSecurityTesterConfig; }
public void CanCreateTlsCompatibilityProcessor() { System.Environment.SetEnvironmentVariable("MxRecordLimit", "1"); System.Environment.SetEnvironmentVariable("RefreshIntervalSeconds", "1"); System.Environment.SetEnvironmentVariable("FailureRefreshIntervalSeconds", "1"); System.Environment.SetEnvironmentVariable("TlsTestTimeoutSeconds", "1"); System.Environment.SetEnvironmentVariable("SmtpHostName", "localhost"); System.Environment.SetEnvironmentVariable("CacheHostName", "localhost"); System.Environment.SetEnvironmentVariable("SnsTopicArn", "localhost"); System.Environment.SetEnvironmentVariable("SnsCertsTopicArn", "localhost"); System.Environment.SetEnvironmentVariable("ConnectionString", "connectionString"); System.Environment.SetEnvironmentVariable("AWS_SECRET_ACCESS_KEY", "AWS_SECRET_ACCESS_KEY"); System.Environment.SetEnvironmentVariable("AWS_ACCESS_KEY_ID", "AWS_ACCESS_KEY_ID"); System.Environment.SetEnvironmentVariable("AWS_SESSION_TOKEN", "AWS_SESSION_TOKEN"); System.Environment.SetEnvironmentVariable("SqsQueueUrl", "SqsQueueUrl"); System.Environment.SetEnvironmentVariable("TlsTesterHostRetestPeriodSeconds", "1"); IMxSecurityTesterProcessor mxSecurityTesterProcessorRunner = MxSecurityTesterFactory.CreateMxSecurityTesterProcessor(); Assert.That(mxSecurityTesterProcessorRunner, Is.Not.Null); }