public void Trace_built_from_exception_has_correct_frames() {
     var trace = new RollbarTrace(GetException());
     Assert.NotNull(trace.Frames);
     Assert.NotEmpty(trace.Frames);
     Assert.Equal(2, trace.Frames.Length);
     Assert.Equal("Rollbar.Test.RollbarTraceFixture.ThrowException()", trace.Frames[0].Method);
     Assert.Equal("Rollbar.Test.RollbarTraceFixture.GetException()", trace.Frames[1].Method);
     Assert.All(trace.Frames, frame => Assert.EndsWith("RollbarTraceFixture.cs", frame.FileName));
 }
 public void Trace_built_from_exception_has_frame_and_exception() {
     var trace = new RollbarTrace(GetException());
     Assert.NotNull(trace.Exception);
     Assert.NotNull(trace.Frames);
     Assert.NotEmpty(trace.Frames);
 }
 public void Trace_built_manually_works_correctly() {
     var trace = new RollbarTrace(new RollbarFrame[0], new RollbarException("BadClass"));
     Assert.Equal("BadClass", trace.Exception.Class);
     Assert.Empty(trace.Frames);
 }
示例#4
0
 public RollbarBody(Exception exception) {
     if (exception == null) {
         throw new ArgumentNullException("exception");
     }
     Trace = new RollbarTrace(exception);
 }