public void visualize_BehaviorFinish_with_no_exceptions()
        {
            var finish = new BehaviorFinish(new BehaviorCorrelation(new FakeNode()));

            var tag = new BehaviorStartAndFinishEndpoints().VisualizePartial(finish);

            tag.Children.Any(x => x.HasClass("exception")).ShouldBeFalse();
            tag.Next.ShouldBeNull();
        }
Example #2
0
        public void is_successful_after_capturing_an_exception()
        {
            var correlation = new BehaviorFinish(new BehaviorCorrelation(new FakeNode()));

            var ex = new NotImplementedException("What?");
            correlation.LogException(ex);

            correlation.Succeeded.ShouldBeFalse();
            correlation.Exception.ShouldNotBeNull();
        }
        public void visualize_BehaviorFinish_with_an_exception()
        {
            var finish = new BehaviorFinish(new BehaviorCorrelation(new FakeNode()));
            finish.LogException(new NotImplementedException());

            var tag = new BehaviorStartAndFinishEndpoints().VisualizePartial(finish);
            tag.Children.FirstOrDefault(x => x.HasClass("exception")).Text().ShouldEqual(
                typeof (NotImplementedException).Name);

            tag.Next.ShouldBeOfType<ExceptionReportTag>();
        }
Example #4
0
 public bool Equals(BehaviorFinish other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other._correlation, _correlation));
 }
        public HtmlTag VisualizePartial(BehaviorFinish finish)
        {
            var description = Description.For(finish.Correlation.Node);

            var tag = new HtmlTag("div").AddClass("behavior-finish");

            tag.Add("span").Text("Finished ").Add("i").Text(description.Title);
            if (!finish.Succeeded)
            {
                tag.Next = new ExceptionReportTag(finish.Exception);

                tag.Add("span").Text(finish.Exception.ExceptionType).AddClass("exception");
            }

            tag.PrependGlyph("icon-chevron-up");

            return tag;
        }
Example #6
0
 public bool Equals(BehaviorFinish other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other._correlation, _correlation);
 }