示例#1
0
 public void MarkFinished()
 {
     _exceptions.Clear();
     _stopwatch.Stop();
     _activity.MarkEnd(requestTime());
     ExecutionTime = requestTime();
 }
示例#2
0
 public void FinishSubject()
 {
     if (_activityStack.Any())
     {
         current.MarkEnd(requestTime());
         _activityStack.Pop();
     }
 }
示例#3
0
        public void mark_end_and_duration()
        {
            var subject = MockRepository.GenerateMock<ISubject>();
            var activity = new Activity(subject, 125);

            activity.MarkEnd(200);

            activity.Duration.ShouldBe(75);
        }
示例#4
0
        public void inner_time()
        {
            var subject = MockRepository.GenerateMock<ISubject>();
            var activity = new Activity(subject, 125);

            activity.MarkEnd(500);

            activity.InnerTime.ShouldBe(500 - 125);
        }
示例#5
0
        public void inner_time_with_nesteds()
        {
            var subject = MockRepository.GenerateMock<ISubject>();
            var activity = new Activity(subject, 125);

            activity.MarkEnd(500);

            var nested1 = new Activity(subject, 150);
            nested1.MarkEnd(175);
            var nested2 = new Activity(subject, 250);
            nested2.MarkEnd(290);
            activity.Nested.Add(nested1);
            activity.Nested.Add(nested2);

            activity.InnerTime.ShouldBe(500 - 125 - 25 - 40);
        }