public void GetChannelsToLastCycleTest(long monitorLastTestCycleTicks, int expectedCount)
        {
            // Arrange
            var scenarioId = 2;

            var scenarioItems = new List <NcScenarioItem>(new NcScenarioItem[]
            {
                new NcScenarioItem {
                    ScenarioId = 1, TestCycleInterval = TimeSpan.MinValue
                },
                new NcScenarioItem {
                    ScenarioId = 1, TestCycleInterval = TimeSpan.MaxValue
                },
                new NcScenarioItem
                {
                    ScenarioId        = 2,
                    TestCycleInterval = new TimeSpan(10),
                    Channel           = new NcChannel {
                        Id = 2
                    },
                },
                new NcScenarioItem
                {
                    ScenarioId        = 2,
                    TestCycleInterval = new TimeSpan(20),
                    Channel           = new NcChannel {
                        Id = 3
                    },
                },
                new NcScenarioItem
                {
                    ScenarioId        = 2,
                    TestCycleInterval = new TimeSpan(30),
                    Channel           = new NcChannel {
                        Id = 4
                    },
                },
                new NcScenarioItem {
                    ScenarioId = 3, TestCycleInterval = TimeSpan.MinValue
                },
                new NcScenarioItem {
                    ScenarioId = 3, TestCycleInterval = TimeSpan.MinValue
                },
                new NcScenarioItem {
                    ScenarioId = 3, TestCycleInterval = TimeSpan.MaxValue
                },
            });

            var monitor = new NcMonitor
            {
                ScenarioId            = scenarioId,
                LastTestCycleInterval = new TimeSpan(monitorLastTestCycleTicks),
            };

            var expected = scenarioItems
                           .Where(x => x.ScenarioId == scenarioId &&
                                  x.TestCycleInterval <= monitor.LastTestCycleInterval)
                           .Select(x => x.Channel)
                           .ToList();

            var scenarioRepo = new Mock <IScenarioRepository>();

            scenarioRepo.Setup(x => x.GetItems(scenarioId))
            .Returns((int targetId) => scenarioItems.Where(x => x.ScenarioId == targetId).AsQueryable());

            IMonitorManager monitorManager = new MonitorManager(
                It.IsAny <IChannelRepository>(),
                It.IsAny <IMonitorRepository>(),
                It.IsAny <IRecordRepository>(),
                scenarioRepo.Object);

            // Act
            var actual = monitorManager.GetChannelsToLastCycleTest(monitor);

            // Assert
            Assert.Equal(expectedCount, actual.Count);
            expected.ToExpectedObject().ShouldEqual(actual);
        }