Beispiel #1
0
        public void TestAddSeveralEntries()
        {
            var logFile = new InMemoryLogSource();
            var index   = new PresentationLogSource(_scheduler, logFile, TimeSpan.Zero, TextSettings.Default);

            logFile.Add(new LogEntry {
                RawContent = "Foo"
            });
            _scheduler.RunOnce();
            index.MaximumWidth.Should().BeApproximately(19.8, 0.1);
            index.LineCount.Should().Be(1);

            logFile.Add(new LogEntry {
                RawContent = "Hello,\r\nWorld!"
            });
            _scheduler.RunOnce();
            index.MaximumWidth.Should().BeApproximately(46.2, 0.1);
            index.LineCount.Should().Be(3);

            logFile.Add(new LogEntry {
                RawContent = "Bar"
            });
            _scheduler.RunOnce();
            index.MaximumWidth.Should().BeApproximately(46.2, 0.1);
            index.LineCount.Should().Be(4);
        }
Beispiel #2
0
        public void TestEmptyFile()
        {
            var index = new PresentationLogSource(_scheduler, new InMemoryLogSource(), TextSettings.Default);

            _scheduler.RunOnce();
            index.MaximumWidth.Should().Be(0);
            index.LineCount.Should().Be(0);
        }
Beispiel #3
0
        public void TestOneLine()
        {
            var logFile = new InMemoryLogSource();
            var index   = new PresentationLogSource(_scheduler, logFile, TimeSpan.Zero, TextSettings.Default);

            logFile.Add(new LogEntry {
                RawContent = "Hello, World!"
            });

            _scheduler.RunOnce();
            index.MaximumWidth.Should().BeApproximately(85, 1);
            index.LineCount.Should().Be(1);
        }