예제 #1
0
        public async Task OpenLogAsync()
        {
            var setting = new CsvFile(UnitTestInitializeCsv.GetTestPath("LogFile.json"))
            {
                JsonFormat = true
            };

            using (var dpd = new CustomProcessDisplay(UnitTestInitializeCsv.Token))
                using (var jfr = new JsonFileReader(setting, dpd))
                {
                    await jfr.OpenAsync(dpd.CancellationToken);

                    await jfr.ReadAsync(dpd.CancellationToken);

                    Assert.AreEqual("level", jfr.GetColumn(1).Name);
                    Assert.AreEqual("Error", jfr.GetValue(1));

                    await jfr.ReadAsync(dpd.CancellationToken);

                    Assert.AreEqual("Reading EdgeAPI vw_rpt_transcript", jfr.GetValue(2));

                    await jfr.ReadAsync(dpd.CancellationToken);

                    Assert.AreEqual("System.Data.DataException", jfr.GetValue(4));
                }
        }