예제 #1
0
        public void MergeLog_DifferentLoggers_Merge()
        {
            var gwLog     = new Log("GameWarrior", new GameWarriorLogParser(), new FileInput("GW_TestLog1.log"));
            var mgpLog    = new Log("MGP", new Log4NetLogParser(), new FileInput("MGP_TestLog1.log"));
            var aggregate = new AggregateLog();

            aggregate.MergeLog(gwLog);
            aggregate.MergeLog(mgpLog);
            var output = aggregate.ToString();
        }
예제 #2
0
        public void MergeLog_FromDifferentLoggers()
        {
            var log1 = new Log("GameWarrior");

            log1.AddEntries(new[] { _entries[0], _entries[1] });

            var log2 = new Log("MGP");

            log2.AddEntries(new[] { _entries[2], _entries[3] });

            var agg = new AggregateLog();

            agg.MergeLog(log1);
            agg.MergeLog(log2);
            Assert.AreEqual(4, agg.NamedEntries.Count);
            var str = agg.ToString();

            StringAssert.Contains(str, "GameWarrior");
            StringAssert.Contains(str, "MGP");
        }
예제 #3
0
        public void MergeLog_TakesAllEntries()
        {
            var log = new Log("GameWarrior");

            log.AddEntries(new [] { _entries[0], _entries[1] });

            var agg = new AggregateLog();

            agg.MergeLog(log);
            Assert.AreEqual(2, agg.NamedEntries.Count);
        }
예제 #4
0
        public void ToString_PrependsOriginLogName()
        {
            var log = new Log("GameWarrior");

            log.AddEntries(new[] { _entries[0], _entries[1] });

            var agg = new AggregateLog();

            agg.MergeLog(log);

            var result = agg.ToString();

            StringAssert.StartsWith(result, "GameWarrior");
        }
예제 #5
0
        public void MergeLog_OrdersByDateTime()
        {
            var log1 = new Log("GameWarrior");

            log1.AddEntries(new[] { _entries[3], _entries[0], _entries[2], _entries[1] });

            var agg = new AggregateLog();

            agg.MergeLog(log1);
            var result = agg.NamedEntries;

            Assert.AreEqual(result[0].Entry, _entries[0]);
            Assert.AreEqual(result[1].Entry, _entries[1]);
            Assert.AreEqual(result[2].Entry, _entries[2]);
            Assert.AreEqual(result[3].Entry, _entries[3]);
        }