public void only_detect_anomalies_in_interval()
        {
            var anomalyResult = _strategy.Detect(data, (25, 31));

            var expected = Enumerable.Range(25, 6)
                           .Select(value => (value, new Anomaly(data[value], 1.0)));

            anomalyResult.SequenceEqual(expected).ShouldBeTrue();
        }
        public void detect_no_anomalies_if_factors_are_set_to_max_value()
        {
            var strategy      = new OnlineNormalStrategy(Double.MaxValue, Double.MaxValue);
            var anomalyResult = strategy.Detect(data, (0, int.MaxValue));

            var expected = Enumerable.Empty <(int, Anomaly)>();

            anomalyResult.SequenceEqual(expected).ShouldBeTrue();
        }
        public void detect_all_anomalies_if_no_interval_specified()
        {
            var strategy = new OnlineNormalStrategy(3.5, 3.5, 0.2);

            var anomalyResult = strategy.Detect(data, (0, int.MaxValue));

            var expected = Enumerable.Range(20, 11)
                           .Select(value => (value, new Anomaly(data[value], 1.0)));

            anomalyResult.SequenceEqual(expected).ShouldBeTrue();
        }
        public void ignore_upper_factor_if_none_is_given()
        {
            var strategy = new OnlineNormalStrategy(1.5, Option <double> .None);

            var anomalyResult = strategy.Detect(data, (0, int.MaxValue));

            var expected = Enumerable
                           .Range(21, 9)
                           .Where(x => x % 2 != 0)
                           .Select(value => (value, new Anomaly(data[value], 1.0)));

            anomalyResult.SequenceEqual(expected).ShouldBeTrue();
        }