public void GetReportEmailConfiguration_WithNonExistingReport_ReturnsNull() { _configuration = new EmailReportingConfiguration(); ReportEmailConfiguration report = _configuration.GetReportEmailConfiguration(EmailReportingConfigurationData.REPORT_NAME); Assert.IsNull(report); }
public void GetReportEmailConfiguration_WithExistingReport_ReturnsConfiguration() { ReportEmailConfiguration report = new ReportEmailConfiguration(EmailReportingConfigurationData.REPORT_NAME, EmailReportingConfigurationData.SUBJECT); _configuration = new EmailReportingConfiguration(); _configuration.AddReport(report); ReportEmailConfiguration retrieved = _configuration.GetReportEmailConfiguration(EmailReportingConfigurationData.REPORT_NAME); Assert.IsNotNull(retrieved); }
public void LoadFromString_WithAReport_ReturnsReportInfo() { _configuration = EmailReportingConfiguration.LoadFromString(EmailReportingConfigurationData.ONE_REPORT_CONFIG, _reportKeys); ReportEmailConfiguration report = _configuration.GetReportEmailConfiguration(EmailReportingConfigurationData.REPORT_NAME); Assert.AreEqual(EmailReportingConfigurationData.SENDER_EMAIL, _configuration.SenderEmail); Assert.AreEqual(EmailReportingConfigurationData.PASSWORD, _configuration.Password); Assert.AreEqual(EmailReportingConfigurationData.MAIL_SERVER, _configuration.MailServer); Assert.AreEqual(EmailReportingConfigurationData.PORT, _configuration.Port); Assert.AreEqual(1, _configuration.ReportCount); Assert.AreEqual(EmailReportingConfigurationData.REPORT_NAME, report.ReportName); Assert.AreEqual(EmailReportingConfigurationData.RECIPIENT, report.ToList.FirstOrDefault()); Assert.IsNull(report.CcList.FirstOrDefault()); Assert.AreEqual(EmailReportingConfigurationData.SUBJECT, report.Subject); }