Beispiel #1
0
        public void ThreadTimeShouldEqualSumOfHighestLevelMethodsTimes()
        {
            ITracer tracer = new MethodTracer();
            ClassWithSeveralMethods classWithSeveralMethods = new ClassWithSeveralMethods(tracer);

            classWithSeveralMethods.MethodWithInnerMethods();
            TraceResult traceResult = tracer.GetTraceResult();

            Assert.Equal(traceResult.Threads[0].Time, traceResult.Threads[0].Methods.Select(method => method.Time).Sum());
        }
Beispiel #2
0
        public void FirstMethodResultShouldContainOneInnerMethod()
        {
            ITracer tracer = new MethodTracer();
            ClassWithSeveralMethods classWithSeveralMethods = new ClassWithSeveralMethods(tracer);

            classWithSeveralMethods.MethodWithInnerMethods();
            TraceResult traceResult = tracer.GetTraceResult();

            Assert.Single(traceResult.Threads[0].Methods[0].Methods);
        }
Beispiel #3
0
        public void TracerShouldTraceTwoMethodsOnHighestLevel()
        {
            ITracer tracer = new MethodTracer();
            ClassWithSeveralMethods classWithSeveralMethods = new ClassWithSeveralMethods(tracer);

            classWithSeveralMethods.MethodWithInnerMethods();
            TraceResult traceResult = tracer.GetTraceResult();

            Assert.Equal(2, traceResult.Threads[0].Methods.Count);
        }