public void GivenThereEmailsRecievedFromAEmailAddress(int noOfEmails, string valid)
 {
     if (valid.ToLower() == "valid")
     {
         EmailGenerationHelper.GenerateEmails(_username, _testValidEmailAccount, _testValidEmailPassword, noOfEmails);
     }
     else
     {
         EmailGenerationHelper.GenerateEmails(_username, _testInvalidEmailAccount, _testInvalidEmailPassword, noOfEmails);
     }
 }
        public void StartUp()
        {
            _testConfiguration = new ConfigurationBuilder()
                                 .AddJsonFile("appsettings.json", optional: true)
                                 .Build();
            _username = _testConfiguration["HighlightMailbox:Username"];
            Assert.IsFalse(string.IsNullOrWhiteSpace(_username), "Invalid configuration Highlight:Username");
            _password = _testConfiguration["HighlightMailbox:Password"];
            Assert.IsFalse(string.IsNullOrWhiteSpace(_password), "Invalid configuration HighlightMailbox:Password");
            _invalidUsername = _testConfiguration["HighlightMailbox:InvalidUsername"];
            Assert.IsFalse(string.IsNullOrWhiteSpace(_invalidUsername), "Invalid configuration Highlight:InvalidUsername");
            _invalidPassword = _testConfiguration["HighlightMailbox:InvalidPassword"];
            Assert.IsFalse(string.IsNullOrWhiteSpace(_invalidPassword), "Invalid configuration HighlightMailbox:InvalidPassword");
            _validFromEmailAddress = _testConfiguration["HighlightMailbox:ValidFromEmailAddress"];
            Assert.IsFalse(string.IsNullOrWhiteSpace(_validFromEmailAddress), "Invalid configuration HighlightMailbox:ValidFromEmailAddress");
            _invalidFromEmailAddress = _testConfiguration["HighlightMailbox:InvalidFromEmailAddress"];
            Assert.IsFalse(string.IsNullOrWhiteSpace(_invalidFromEmailAddress), "Invalid configuration HighlightMailbox:InvalidFromEmailAddress");


            _testValidEmailAccount = _testConfiguration["HighlightMailbox:TestValidEmailAccount"];
            Assert.IsFalse(string.IsNullOrWhiteSpace(_testValidEmailAccount), "Invalid configuration Highlight:TestValidEmailAccount");
            _testValidEmailPassword = _testConfiguration["HighlightMailbox:TestValidEmailPassword"];
            Assert.IsFalse(string.IsNullOrWhiteSpace(_testValidEmailPassword), "Invalid configuration Highlight:TestValidEmailPassword");

            _testInvalidEmailAccount = _testConfiguration["HighlightMailbox:TestInvalidEmailAccount"];
            Assert.IsFalse(string.IsNullOrWhiteSpace(_testInvalidEmailAccount), "Invalid configuration Highlight:TestValidEmailAccount");
            _testInvalidEmailPassword = _testConfiguration["HighlightMailbox:TestInvalidEmailPassword"];
            Assert.IsFalse(string.IsNullOrWhiteSpace(_testInvalidEmailPassword), "Invalid configuration Highlight:TestInvalidEmailPassword");

            _highlightDatabaseConnection = _testConfiguration["Data:HighlightDatabaseConnectionString"];
            Assert.IsFalse(string.IsNullOrWhiteSpace(_highlightDatabaseConnection), "Invalid configuration Data:HighlightDatabaseConnectionString");

            _emailConnectionHelperUrl = _testConfiguration["HighlightMailbox:communicationApi"];
            Assert.IsFalse(string.IsNullOrWhiteSpace(_emailConnectionHelperUrl), "Invalid configuration HighlightMailbox:communicationApi");


            StaticVariables.Logger        = new Mock <ILogger>();
            StaticVariables.Configuration = new Mock <IConfiguration>();
            EmailGenerationHelper.ClearOutMailbox(_username, _password);
            new DatabaseHelper(_highlightDatabaseConnection).ClearTable("Highlight.EmailAlerts");
        }