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}") ); }
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()); }
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); }