Beispiel #1
0
        public void TestUpdateVisibleLine1()
        {
            var logFile = new Mock <ILogSource>();

            logFile.Setup(x => x.GetProperty(Properties.LogEntryCount)).Returns(42);
            _control.LogSource = logFile.Object;

            logFile.Setup(x => x.GetEntries(It.IsAny <LogSourceSection>(), It.IsAny <ILogBuffer>(), It.IsAny <int>(), It.IsAny <LogSourceQueryOptions>()))
            .Throws <IndexOutOfRangeException>();

            new Action(() => _control.UpdateVisibleLines()).Should().NotThrow();

            logFile.Setup(x => x.GetEntries(It.IsAny <LogSourceSection>(), It.IsAny <ILogBuffer>(), It.IsAny <int>(), It.IsAny <LogSourceQueryOptions>()))
            .Throws <ArgumentOutOfRangeException>();
            new Action(() => _control.UpdateVisibleLines()).Should().NotThrow();
        }
Beispiel #2
0
        public void TestUpdateVisibleLine1()
        {
            var logFile = new Mock <ILogFile>();

            logFile.Setup(x => x.Count).Returns(42);
            _control.LogFile = logFile.Object;

            logFile.Setup(x => x.GetSection(It.IsAny <LogFileSection>(), It.IsAny <LogLine[]>()))
            .Throws <IndexOutOfRangeException>();

            new Action(() => _control.UpdateVisibleLines()).Should().NotThrow();

            logFile.Setup(x => x.GetSection(It.IsAny <LogFileSection>(), It.IsAny <LogLine[]>()))
            .Throws <ArgumentOutOfRangeException>();
            new Action(() => _control.UpdateVisibleLines()).Should().NotThrow();
        }