public void LoadAsync() { Stream stream = TestOsdStream.GenerateUncompressedFrom(TestEventXml.E001_Error, TestEventXml.E083_CreateSocket, TestEventXml.E140_CloseSocket); DumpLoader loader = new DumpLoader(); AutoResetEvent completed = new AutoResetEvent(false); Dump dump = null; List <ProgressChangedEventArgs> progressEvents = new List <ProgressChangedEventArgs>(); loader.LoadProgressChanged += delegate(object sender, ProgressChangedEventArgs e) { lock (progressEvents) progressEvents.Add(e); }; loader.LoadCompleted += delegate(object sender, LoadCompletedEventArgs e) { dump = e.Dump; completed.Set(); }; loader.LoadAsync(stream, this); completed.WaitOne(); VerifyEvents(dump); Assert.That(progressEvents.Count, Is.EqualTo(3)); Assert.That(progressEvents[0].ProgressPercentage, Is.EqualTo(33)); Assert.That(progressEvents[1].ProgressPercentage, Is.EqualTo(66)); Assert.That(progressEvents[2].ProgressPercentage, Is.EqualTo(100)); }
public void LoadTags() { Stream stream = TestOsdStream.GenerateUncompressedFrom(TestEventXml.E083_CreateSocket); DumpLoader loader = new DumpLoader(); Dump dump = loader.Load(stream); Assert.That(dump.Events[83].Tags.Count, Is.AtLeast(1)); }
public void LoadCompressed() { Stream stream = TestOsdStream.GenerateCompressedFrom(TestEventXml.E001_Error, TestEventXml.E083_CreateSocket, TestEventXml.E140_CloseSocket); LoadAndVerifyEvents(stream); }