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

            _activity = new Activity(this, 0);
            _activityStack.Push(_activity);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
        public void StartSubject(ISubject subject)
        {
            var activity = new Activity(subject, requestTime());
            current.Nested.Add(activity);

            _activityStack.Push(activity);
        }