Пример #1
0
 public void EndEntryTest()
 {
     var target = new Trace_Accessor();
     string description = "Entry description.";
     severityType severity = severityType.INFO;
     IDictionary<string, object> properties = new Dictionary<String, Object>() { { "prop1", "asd" } };
     Entry expected = new Entry(description, severity);
     Entry actual = target.BeginEntry(description, severity, properties);
     Thread.Sleep(10);
     target.EndEntry();
     Assert.IsTrue(actual.Offset >= 0);
     Assert.IsTrue(actual.Duration > 0);
 }
Пример #2
0
 public void BeginEntryTest()
 {
     var target = new Trace_Accessor();
     string description = "Entry description.";
     severityType severity = severityType.INFO;
     IDictionary<string, object> properties = new Dictionary<String, Object>() { { "prop1", "asd" } };
     Entry expected = new Entry(description, severity);
     Entry actual = target.BeginEntry(description, severity, properties);
     // Align offsets witch isn't predictable
     expected.Offset = actual.Offset;
     Assert.AreEqual(expected, actual);
     Assert.IsTrue(target.Context.Count == 1);
     Assert.AreEqual(expected, target.Context.Peek());
 }