Exemplo n.º 1
0
 static public void Test(Tracer tracer)
 {
     tracer.StartTrace();
     TestEZ.Test(tracer);
     RecursionTest.Test(1, tracer);
     tracer.StopTrace();
 }
Exemplo n.º 2
0
 static public void Test(Tracer tracer)
 {
     tracer.StartTrace();
     tracer = null;
     TestEZ.Test(tracer);
     tracer.StopTrace();
 }
Exemplo n.º 3
0
 static public void InsertTestMethod(Tracer tracer)
 {
     tracer.StartTrace();
     TestEZ.Test(tracer);
     Thread.Sleep(10);
     tracer.StopTrace();
 }
Exemplo n.º 4
0
 static public void Test(int i, Tracer tracer)
 {
     tracer.StartTrace();
     i++;
     TestEZ.Test(tracer);
     if (i < 2)
     {
         Test(i, tracer);
     }
     tracer.StopTrace();
 }
Exemplo n.º 5
0
        public void TestRowMethod()
        {
            TestEZ.Test(tracer);
            TestEZ.Test(tracer);
            TestEZ.Test(tracer);
            var actual   = tracer.GetTraceResult().Theards[Thread.CurrentThread.ManagedThreadId].Methods.Count;
            var expected = new MethodTraceResult();

            expected.Methods.Add(new MethodTraceResult());
            expected.Methods.Add(new MethodTraceResult());
            expected.Methods.Add(new MethodTraceResult());
            try
            {
                Assert.AreEqual(expected.Methods.Count, actual);
                logger.Info(nameof(TestRowMethod) + " - passed");
            }
            catch (Exception e)
            {
                logger.Error(e, nameof(TestRowMethod) + " - failed");
            }
        }
Exemplo n.º 6
0
        public void TestEZMethod()
        {
            TestEZ.Test(tracer);
            var actual   = tracer.GetTraceResult().Theards[Thread.CurrentThread.ManagedThreadId].Methods[0];
            var expected = new MethodTraceResult();

            expected.MethodName      = "Test";
            expected.MethodClassName = "TestEZ";
            try
            {
                Assert.AreEqual(expected.MethodClassName, actual.MethodClassName);
                Assert.AreEqual(expected.MethodName, actual.MethodName);
                Assert.AreEqual(expected.Methods.Count, actual.Methods.Count);
                Assert.IsNotNull(actual.MethodExecuteTime);
                logger.Info(nameof(TestEZMethod) + " - passed");
            }
            catch (Exception e)
            {
                logger.Error(e, nameof(TestEZMethod) + " - failed");
            }
        }