Example #1
0
        public void AlertDoesNotTriggersWhenOldValueMatched(string row, double oldValue, double value)
        {
            var alert = new IOconfAlert(row, 0);

            alert.CheckValue(oldValue, DateTime.UtcNow);
            Assert.IsFalse(alert.CheckValue(value, DateTime.UtcNow));
        }
Example #2
0
        public void AlertTriggersWhenOldValueDidNotMatch(string row, double oldValue, double value)
        {
            var alert = new IOconfAlert(row, 0);

            alert.CheckValue(oldValue, DateTime.UtcNow);
            Assert.IsTrue(alert.CheckValue(value, DateTime.UtcNow));
        }
Example #3
0
        public void AlertReturnsExpectedMessageAfterCheckingValueTwice(string row, double oldValue, double value, string expectedMessage)
        {
            var alert = new IOconfAlert(row, 0);

            alert.CheckValue(oldValue, DateTime.UtcNow);
            alert.CheckValue(value, DateTime.UtcNow);
            Assert.AreEqual(expectedMessage, alert.Message);
        }
Example #4
0
        public void SupportsDynamicAlertsFormat(string expressionWithOptions, double value, int rateLimit, string command)
        {
            var alert = new IOconfAlert("dynamicalert", expressionWithOptions);

            Assert.IsTrue(alert.CheckValue(value, DateTime.UtcNow));
            Assert.AreEqual(rateLimit, alert.RateLimitMinutes);
            Assert.AreEqual(command, alert.Command);
        }
Example #5
0
        public void AlertTriggers(string row, double value)
        {
            var alert = new IOconfAlert(row, 0);

            Assert.IsTrue(alert.CheckValue(value, DateTime.UtcNow));
        }