Beispiel #1
0
        private TaskResult PrepareDelaysTest(int threshold)
        {
            var collector = new Mock <Collector>(null);

            collector.Setup(x => x.Collect(CollectorMode.Delays, It.IsAny <TimeSpan>())).Returns(new List <string>()
            {
                "4, 5, 7, 6", "20, 8, 4, 7", "9, 6, 5, 11", "7, 14, 14, 8", "10, 6, 12, 6"
            });

            var task = new Mock <CollectorTask>();

            task.Setup(x => x.Description).Returns("Task description");
            task.Setup(x => x.MillisecondDuration).Returns(1);
            task.Setup(x => x.Mode).Returns(CollectorMode.Delays);
            task.Setup(x => x.Threshold).Returns(threshold);

            return(CollectorTaskRunner.RunTask(task.Object, collector.Object));
        }
Beispiel #2
0
        private TaskResult RunPerformanceTask(int threshold)
        {
            var collector = new Mock <Collector>(null);

            collector.Setup(x => x.Collect(CollectorMode.Performance, It.IsAny <TimeSpan>())).Returns(new List <string>()
            {
                "90", "95", "99", "94", "96"
            });

            var task = new Mock <CollectorTask>();

            task.Setup(x => x.Description).Returns("Task description");
            task.Setup(x => x.MillisecondDuration).Returns(1);
            task.Setup(x => x.Mode).Returns(CollectorMode.Performance);
            task.Setup(x => x.Threshold).Returns(threshold);

            return(CollectorTaskRunner.RunTask(task.Object, collector.Object));
        }