コード例 #1
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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }