public void TestAnalyzeFunctionIfConditionIsBreachedUsingEmailReporter()
        {
            IReporter reporter = new EmailReporter();
            var       analyzer = new Analyzer(reporter);
            var       result   = analyzer.Analyze(39, "Temperature", 37, 4, 40, 0);

            Assert.False(result);
        }
Ejemplo n.º 2
0
        public EmailReporterTests()
        {
            var configuration = new ConfigurationBuilder()
                                .AddJsonFile("configs/appsettings.json")
                                .Build();
            var mailConfig = configuration.GetSection("mail");

            var mailConfiguration = new MailConfiguration()
            {
                HostSmtp     = mailConfig.GetSection("hostSmtp").Value,
                LoginSmtp    = mailConfig.GetSection("loginSmtp").Value,
                MailFromSmtp = mailConfig.GetSection("mailFromSmtp").Value,
                PasswordSmtp = mailConfig.GetSection("passwordSmtp").Value,
                PortSmtp     = Convert.ToInt32(mailConfig.GetSection("portSmtp").Value),
                SslSmtp      = Convert.ToBoolean(mailConfig.GetSection("sslSmtp").Value)
            };

            _emailReporter = new EmailReporter(mailConfiguration);
        }