Example #1
0
        public void TestAddListener1()
        {
            var logFile = new InMemoryLogFile();

            logFile.AddListener(_listener.Object, TimeSpan.Zero, 1);
            _modifications.Should().Equal(new object[] { LogFileSection.Reset });
        }
Example #2
0
        public void TestClear4()
        {
            var logFile = new InMemoryLogFile();

            logFile.AddEntry("Hi", LevelFlags.Info);
            logFile.MaxCharactersPerLine.Should().Be(2);

            logFile.AddListener(_listener.Object, TimeSpan.Zero, 1);
            logFile.Clear();
            _modifications.Should().EndWith(LogFileSection.Reset);
        }
Example #3
0
        public void TestAddListener2()
        {
            var logFile = new InMemoryLogFile();

            logFile.AddEntry("Foo", LevelFlags.Other);

            logFile.AddListener(_listener.Object, TimeSpan.Zero, 1);
            _modifications.Should().Equal(new object[]
            {
                LogFileSection.Reset,
                new LogFileSection(0, 1)
            });
        }
Example #4
0
        public void TestAddMultilineEntry4()
        {
            var logFile = new InMemoryLogFile();

            logFile.AddListener(_listener.Object, TimeSpan.Zero, 2);

            var t1 = new DateTime(2017, 11, 26, 11, 56, 0);

            logFile.AddMultilineEntry(LevelFlags.Info, t1, "foo", "bar");

            _modifications.Should().Equal(new object[]
            {
                LogFileSection.Reset,
                new LogFileSection(0, 2)
            });
        }