public ChainExecutionLog()
        {
            _request = new Dictionary<string, object>();
            _stopwatch.Start();
            Id = Guid.NewGuid();

            _activity = new Activity(this, 0);
            _activityStack.Push(_activity);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        public void inner_time()
        {
            var subject = MockRepository.GenerateMock<ISubject>();
            var activity = new Activity(subject, 125);

            activity.MarkEnd(500);

            activity.InnerTime.ShouldBe(500 - 125);
        }
Beispiel #4
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);
        }
        public void StartSubject(ISubject subject)
        {
            var activity = new Activity(subject, requestTime());
            current.Nested.Add(activity);

            _activityStack.Push(activity);
        }