示例#1
0
        static void testParser()
        {
            var pt1        = new ParserType1(new LogReader());
            var logEntries = pt1.Parse(@"Logs\log1.txt");

            logEntries.ForEach(e => Console.WriteLine($"level = {e.level}, date = {e.timeStamp}, message = {e.message}")
                               );
        }
示例#2
0
        public void test1()
        {
            // Arrange
            var parser = new ParserType1(new FakeLogReader());

            // Act
            var result = parser.Parse(@"C:\Projects\DotNet\Yu\SimpleUnitSample\SimpleUnitSample.Tests\bin\Debug\Logs\log1.txt");

            // Assert
            Assert.IsNotNull(result);
            Assert.AreNotEqual(0, result.Count());
        }
示例#3
0
        public void parseStringStd()
        {
            // Arrange
            var logReader = new FakeLogReader();

            logReader.LogType = 1;
            var parser = new ParserType1(logReader);

            // Act
            var result = parser.Parse(@"C:\Projects\DotNet\Yu\SimpleUnitSample\SimpleUnitSample.Tests\bin\Debug\Logs\log1.txt");

            // Assert
            Assert.AreEqual("Info", result[0].level.ToString());
            Assert.AreEqual("11:32:03 25.05.18", result[0].timeStamp.ToString());
            //  Assert.AreEqual("Disconnected from Endur", result[0].message);
        }