Ejemplo n.º 1
0
        public void FilterLevel()
        {
            IDefaultActivityLogger l = DefaultActivityLogger.Create();

            // Binds the TestHelper.Logger logger to this one.
            l.Output.RegisterMuxClient(TestHelper.Logger.Output.ExternalInput);

            var log = new StringImpl();

            l.Register(log);
            using (l.Filter(LogLevelFilter.Error))
            {
                l.Trace("NO SHOW");
                l.Info("NO SHOW");
                l.Warn("NO SHOW");
                l.Error("Error n°1");
                using (l.Filter(LogLevelFilter.Warn))
                {
                    l.Trace("NO SHOW");
                    l.Info("NO SHOW");
                    l.Warn("Warn n°1");
                    l.Error("Error n°2");
                    using (l.OpenGroup(LogLevel.Info, "GroupInfo"))
                    {
                        Assert.That(l.Filter, Is.EqualTo(LogLevelFilter.Warn), "Groups does not change the current filter level.");
                        l.Trace("NO SHOW");
                        l.Info("NO SHOW");
                        l.Warn("Warn n°2");
                        l.Error("Error n°3");
                        // Changing the level inside a Group.
                        l.Filter = LogLevelFilter.Fatal;
                        l.Error("NO SHOW");
                        l.Fatal("Fatal n°1");
                    }
                    Assert.That(l.Filter, Is.EqualTo(LogLevelFilter.Warn), "But Groups restores the original filter level when closed.");
                    l.Trace("NO SHOW");
                    l.Info("NO SHOW");
                    l.Warn("Warn n°3");
                    l.Error("Error n°4");
                    l.Fatal("Fatal n°2");
                }
                l.Trace("NO SHOW");
                l.Info("NO SHOW");
                l.Warn("NO SHOW");
                l.Error("Error n°5");
            }
            Assert.That(log.Writer.ToString(), Is.Not.StringContaining("NO SHOW"));
            Assert.That(log.Writer.ToString(), Is.StringContaining("Error n°1")
                        .And.StringContaining("Error n°2")
                        .And.StringContaining("Error n°3")
                        .And.StringContaining("Error n°4")
                        .And.StringContaining("Error n°5"));
            Assert.That(log.Writer.ToString(), Is.StringContaining("Warn n°1")
                        .And.StringContaining("Warn n°2")
                        .And.StringContaining("Warn n°3"));
            Assert.That(log.Writer.ToString(), Is.StringContaining("Fatal n°1")
                        .And.StringContaining("Fatal n°2"));
        }
Ejemplo n.º 2
0
        public void CatchTests()
        {
            IDefaultActivityLogger d = DefaultActivityLogger.Create();

            Assert.Throws <ArgumentNullException>(() => d.Catch(null));

            d.Error("Pouf");
            using (d.Catch(e => Assert.That(String.Join(",", e.Select(t => t.Text)) == "One,Two")))
            {
                d.Error("One");
                d.Warn("Warn");
                d.Fatal("Two");
            }
            d.Error("Out...");
            using (d.Catch(e => e.Single(t => t.Text == "Two"), LogLevelFilter.Fatal))
            {
                d.Error("One");
                d.Warn("Warn");
                d.Fatal("Two");
            }

            using (d.Catch(e => Assert.Fail("No Error occured.")))
            {
                d.Trace("One");
                d.Warn("Warn");
            }

            using (d.Catch(e => Assert.Fail("No Fatal occured."), LogLevelFilter.Fatal))
            {
                d.Error("One");
                d.Warn("Warn");
            }
        }
Ejemplo n.º 3
0
        public void DefaultImpl()
        {
            IDefaultActivityLogger logger = DefaultActivityLogger.Create();

            // Binds the TestHelper.Logger logger to this one.
            logger.Output.RegisterMuxClient(TestHelper.Logger.Output.ExternalInput);

            logger.Register(new StringImpl()).Register(new XmlImpl(new StringWriter()));

            Assert.That(logger.RegisteredSinks.Count, Is.EqualTo(2));

            using (logger.OpenGroup(LogLevel.Trace, () => "EndMainGroup", "MainGroup"))
            {
                logger.Trace("First");
                logger.Trace("Second");
                logger.Trace("Third");
                logger.Info("First");

                using (logger.OpenGroup(LogLevel.Info, () => "EndInfoGroup", "InfoGroup"))
                {
                    logger.Info("Second");
                    logger.Trace("Fourth");

                    using (logger.OpenGroup(LogLevel.Warn, () => "EndWarnGroup", "WarnGroup {0} - Now = {1}", 4, DateTime.UtcNow))
                    {
                        logger.Info("Warn!");
                    }
                }
            }

            Console.WriteLine(logger.RegisteredSinks.OfType <StringImpl>().Single().Writer);
            Console.WriteLine(logger.RegisteredSinks.OfType <XmlImpl>().Single().InnerWriter);

            XPathDocument d = new XPathDocument(new StringReader(logger.RegisteredSinks.OfType <XmlImpl>().Single().InnerWriter.ToString()));

            Assert.That(d.CreateNavigator().SelectDescendants("Info", String.Empty, false), Is.Not.Empty.And.Count.EqualTo(3));
            Assert.That(d.CreateNavigator().SelectDescendants("Trace", String.Empty, false), Is.Not.Empty.And.Count.EqualTo(2));
        }
Ejemplo n.º 4
0
        public void CloseMismatch()
        {
            IDefaultActivityLogger l = DefaultActivityLogger.Create();
            var log = new StringImpl();

            l.Register(log);
            {
                IDisposable g0 = l.OpenGroup(LogLevel.Trace, "First");
                IDisposable g1 = l.OpenGroup(LogLevel.Trace, "Second");
                IDisposable g2 = l.OpenGroup(LogLevel.Trace, "Third");

                g1.Dispose();
                l.Trace("Inside First");
                g0.Dispose();
                l.Trace("At root");

                var end = "Trace: Inside First" + Environment.NewLine + "-" + Environment.NewLine + "Trace: At root";
                Assert.That(log.Writer.ToString(), Is.StringEnding(end));
            }
            {
                // g2 is closed after g1.
                IDisposable g0 = l.OpenGroup(LogLevel.Trace, "First");
                IDisposable g1 = l.OpenGroup(LogLevel.Trace, "Second");
                IDisposable g2 = l.OpenGroup(LogLevel.Trace, "Third");
                log.Writer.GetStringBuilder().Clear();
                g1.Dispose();
                // g2 has already been disposed by g1.
                // Nothing changed.
                g2.Dispose();
                l.Trace("Inside First");
                g0.Dispose();
                l.Trace("At root");

                var end = "Trace: Inside First" + Environment.NewLine + "-" + Environment.NewLine + "Trace: At root";
                Assert.That(log.Writer.ToString(), Is.StringEnding(end));
            }
        }
Ejemplo n.º 5
0
        public void SimpleCollectorTest()
        {
            IDefaultActivityLogger d = DefaultActivityLogger.Create();
            var c = new ActivityLoggerSimpleCollector();

            d.Output.RegisterClient(c);
            d.Warn("1");
            d.Error("2");
            d.Fatal("3");
            d.Trace("4");
            d.Info("5");
            d.Warn("6");
            Assert.That(String.Join(",", c.Entries.Select(e => e.Text)), Is.EqualTo("2,3"));

            c.LevelFilter = LogLevelFilter.Fatal;
            Assert.That(String.Join(",", c.Entries.Select(e => e.Text)), Is.EqualTo("3"));

            c.LevelFilter = LogLevelFilter.Off;
            Assert.That(String.Join(",", c.Entries.Select(e => e.Text)), Is.EqualTo(""));

            c.LevelFilter = LogLevelFilter.Warn;
            using (d.OpenGroup(LogLevel.Warn, "1"))
            {
                d.Error("2");
                using (d.OpenGroup(LogLevel.Fatal, "3"))
                {
                    d.Trace("4");
                    d.Info("5");
                }
            }
            d.Warn("6");
            Assert.That(String.Join(",", c.Entries.Select(e => e.Text)), Is.EqualTo("1,2,3,6"));

            c.LevelFilter = LogLevelFilter.Fatal;
            Assert.That(String.Join(",", c.Entries.Select(e => e.Text)), Is.EqualTo("3"));
        }
Ejemplo n.º 6
0
        public void Overloads()
        {
            Exception ex = new Exception("EXCEPTION");
            string    fmt0 = "fmt", fmt1 = "fmt{0}", fmt2 = "fmt{0}{1}", fmt3 = "fmt{0}{1}{2}", fmt4 = "fmt{0}{1}{2}{3}", fmt5 = "fmt{0}{1}{2}{3}{4}", fmt6 = "fmt{0}{1}{2}{3}{4}{5}";
            string    p1 = "p1", p2 = "p2", p3 = "p3", p4 = "p4", p5 = "p5", p6 = "p6";

            IDefaultActivityLogger d = DefaultActivityLogger.Create();
            var collector            = new ActivityLoggerSimpleCollector()
            {
                LevelFilter = LogLevelFilter.Trace, Capacity = 1
            };

            d.Output.RegisterClient(collector);

            d.Trace(fmt0); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmt"));
            d.Trace(fmt1, p1); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1"));
            d.Trace(fmt2, p1, p2); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2"));
            d.Trace(fmt3, p1, p2, p3); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3"));
            d.Trace(fmt4, p1, p2, p3, p4); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4"));
            d.Trace(fmt5, p1, p2, p3, p4, p5); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5"));
            d.Trace(fmt6, p1, p2, p3, p4, p5, p6); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5p6"));

            d.Info(fmt0); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmt"));
            d.Info(fmt1, p1); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1"));
            d.Info(fmt2, p1, p2); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2"));
            d.Info(fmt3, p1, p2, p3); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3"));
            d.Info(fmt4, p1, p2, p3, p4); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4"));
            d.Info(fmt5, p1, p2, p3, p4, p5); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5"));
            d.Info(fmt6, p1, p2, p3, p4, p5, p6); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5p6"));

            d.Warn(fmt0); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmt"));
            d.Warn(fmt1, p1); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1"));
            d.Warn(fmt2, p1, p2); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2"));
            d.Warn(fmt3, p1, p2, p3); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3"));
            d.Warn(fmt4, p1, p2, p3, p4); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4"));
            d.Warn(fmt5, p1, p2, p3, p4, p5); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5"));
            d.Warn(fmt6, p1, p2, p3, p4, p5, p6); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5p6"));

            d.Error(fmt0); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmt"));
            d.Error(fmt1, p1); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1"));
            d.Error(fmt2, p1, p2); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2"));
            d.Error(fmt3, p1, p2, p3); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3"));
            d.Error(fmt4, p1, p2, p3, p4); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4"));
            d.Error(fmt5, p1, p2, p3, p4, p5); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5"));
            d.Error(fmt6, p1, p2, p3, p4, p5, p6); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5p6"));

            d.Fatal(fmt0); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmt"));
            d.Fatal(fmt1, p1); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1"));
            d.Fatal(fmt2, p1, p2); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2"));
            d.Fatal(fmt3, p1, p2, p3); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3"));
            d.Fatal(fmt4, p1, p2, p3, p4); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4"));
            d.Fatal(fmt5, p1, p2, p3, p4, p5); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5"));
            d.Fatal(fmt6, p1, p2, p3, p4, p5, p6); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5p6"));

            d.OpenGroup(LogLevel.Trace, fmt0); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmt"));
            d.OpenGroup(LogLevel.Trace, fmt1, p1); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1"));
            d.OpenGroup(LogLevel.Trace, fmt2, p1, p2); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2"));
            d.OpenGroup(LogLevel.Trace, fmt3, p1, p2, p3); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3"));
            d.OpenGroup(LogLevel.Trace, fmt4, p1, p2, p3, p4); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4"));
            d.OpenGroup(LogLevel.Trace, fmt5, p1, p2, p3, p4, p5); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5"));
            d.OpenGroup(LogLevel.Trace, fmt6, p1, p2, p3, p4, p5, p6); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5p6"));

            d.Trace(ex); Assert.That(collector.Entries.Last().Text, Is.EqualTo("EXCEPTION")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Trace(ex, fmt0); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmt")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Trace(ex, fmt1, p1); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Trace(ex, fmt2, p1, p2); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Trace(ex, fmt3, p1, p2, p3); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Trace(ex, fmt4, p1, p2, p3, p4); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Trace(ex, fmt5, p1, p2, p3, p4, p5); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Trace(ex, fmt6, p1, p2, p3, p4, p5, p6); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5p6")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));

            d.Info(ex); Assert.That(collector.Entries.Last().Text, Is.EqualTo("EXCEPTION")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Info(ex, fmt0); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmt")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Info(ex, fmt1, p1); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Info(ex, fmt2, p1, p2); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Info(ex, fmt3, p1, p2, p3); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Info(ex, fmt4, p1, p2, p3, p4); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Info(ex, fmt5, p1, p2, p3, p4, p5); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Info(ex, fmt6, p1, p2, p3, p4, p5, p6); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5p6")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));

            d.Warn(ex); Assert.That(collector.Entries.Last().Text, Is.EqualTo("EXCEPTION")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Warn(ex, fmt0); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmt")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Warn(ex, fmt1, p1); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Warn(ex, fmt2, p1, p2); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Warn(ex, fmt3, p1, p2, p3); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Warn(ex, fmt4, p1, p2, p3, p4); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Warn(ex, fmt5, p1, p2, p3, p4, p5); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Warn(ex, fmt6, p1, p2, p3, p4, p5, p6); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5p6")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));

            d.Error(ex); Assert.That(collector.Entries.Last().Text, Is.EqualTo("EXCEPTION")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Error(ex, fmt0); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmt")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Error(ex, fmt1, p1); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Error(ex, fmt2, p1, p2); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Error(ex, fmt3, p1, p2, p3); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Error(ex, fmt4, p1, p2, p3, p4); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Error(ex, fmt5, p1, p2, p3, p4, p5); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Error(ex, fmt6, p1, p2, p3, p4, p5, p6); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5p6")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));

            d.Fatal(ex); Assert.That(collector.Entries.Last().Text, Is.EqualTo("EXCEPTION")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Fatal(ex, fmt0); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmt")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Fatal(ex, fmt1, p1); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Fatal(ex, fmt2, p1, p2); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Fatal(ex, fmt3, p1, p2, p3); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Fatal(ex, fmt4, p1, p2, p3, p4); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Fatal(ex, fmt5, p1, p2, p3, p4, p5); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.Fatal(ex, fmt6, p1, p2, p3, p4, p5, p6); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5p6")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));

            d.OpenGroup(LogLevel.Trace, ex); Assert.That(collector.Entries.Last().Text, Is.EqualTo("EXCEPTION")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.OpenGroup(LogLevel.Trace, ex, fmt0); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmt")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.OpenGroup(LogLevel.Trace, ex, fmt1, p1); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.OpenGroup(LogLevel.Trace, ex, fmt2, p1, p2); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.OpenGroup(LogLevel.Trace, ex, fmt3, p1, p2, p3); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.OpenGroup(LogLevel.Trace, ex, fmt4, p1, p2, p3, p4); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.OpenGroup(LogLevel.Trace, ex, fmt5, p1, p2, p3, p4, p5); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
            d.OpenGroup(LogLevel.Trace, ex, fmt6, p1, p2, p3, p4, p5, p6); Assert.That(collector.Entries.Last().Text, Is.EqualTo("fmtp1p2p3p4p5p6")); Assert.That(collector.Entries.Last().Exception, Is.SameAs(ex));
        }