Exemple #1
0
        public void CompactJsonFormatTestAutomaticDetection(string fileName, FileFormat format)
        {
            string file = Path.Combine(Folder, "log files", fileName);
            var    type = OfflineDataProvider.TryDetectFormat(file);

            Assert.IsTrue(type == format);
        }
        public async Task TestMethod1()
        {
            var parser = new OfflineDataProvider();
            await parser.InitializeDataProviderAsync(null);

            var results = await parser.Process("2020-10-03.txt", new CancellationToken(), new MessageHandlerForTesting());

            Assert.IsTrue(results.Count() == 61);
        }
Exemple #3
0
        public async Task TestMethod2()
        {
            var parser = new OfflineDataProvider();
            await parser.InitializeDataProviderAsync(null);

            var results = await parser.Process("1_build (Debug).txt", new CancellationToken(), new MessageHandlerForTesting());

            Assert.IsTrue(Enumerable.Count <AnalogyLogMessage>(results) == 4532);
        }
        public async Task OfflineProviderParserTimestampTest(string fileName, int numberOfMessages, string datetimeToParse)
        {
            OfflineDataProvider     parser = new OfflineDataProvider();
            CancellationTokenSource cts    = new CancellationTokenSource();
            string file = Path.Combine(Folder, "log files", fileName);
            MessageHandlerForTesting forTesting = new MessageHandlerForTesting();
            var            messages             = (await parser.Process(file, cts.Token, forTesting)).ToList();
            DateTimeOffset dto = DateTimeOffset.Parse(datetimeToParse);

            Assert.IsTrue(messages.Count == numberOfMessages);
            Assert.IsTrue(messages[0].Date == dto.DateTime);
        }