示例#1
0
 private void DoOtherThreadWork()
 {
     using (Tracer tracer = new Tracer(Context, testCategory1, testActivityId1))
     {
         Assert.IsNotNull(tracer);
         Assert.AreEqual(testActivityId1, Tracer.CurrentActivityId);
     }
 }
示例#2
0
        public void LogMessageContainsProperMethodName()
        {
            using (Tracer tracer = new Tracer(Context, Tracer.defaultCategory, null))
            {
                Assert.IsNotNull(tracer);
            }

            Assert.AreEqual(2, MockLogSink.Count);
            AssertStringContainsString(MockLogSink.GetEntry(0).Message, MethodInfo.GetCurrentMethod().Name);
            AssertStringContainsString(MockLogSink.GetEntry(1).Message, MethodInfo.GetCurrentMethod().Name);
        }
示例#3
0
 public void OmittingActivityIdDoesntOverwriteExistingActivityId()
 {
     using (Tracer tracer1 = new Tracer(Context, testCategory1, testActivityId1))
     {
         Assert.IsNotNull(tracer1);
         using (Tracer tracer2 = new Tracer(Context, testCategory1, null))
         {
             Assert.IsNotNull(tracer2);
             Assert.AreEqual(testActivityId1, Tracer.CurrentActivityId);
         }
     }
 }