public void Record() { var ex = new TestException1("outer", new TestException2()); exceptionRecorder.Record(TestClass.MethodInfo1, ex); var exceptionData = new VSIExceptionData { CatchSite = TestClass.MethodInfo1.GetProto() }; exceptionData.ExceptionsChain.Add( new VSIExceptionData.Types.Exception { ExceptionType = typeof(TestException1).GetProto() }); exceptionData.ExceptionsChain.Add( new VSIExceptionData.Types.Exception { ExceptionType = typeof(TestException2).GetProto() }); var logEvent = new DeveloperLogEvent { StatusCode = DeveloperEventStatus.Types.Code.InternalError }; logEvent.ExceptionsData.Add(exceptionData); fakeMetrics.Received().RecordEvent( DeveloperEventType.Types.Type.VsiException, logEvent); }
public void RecordExceptionChainTooLong() { var ex = new TestException1("level1", new TestException1("level2", new TestException1("level3", new TestException2()))); exceptionRecorder.Record(TestClass.MethodInfo1, ex); fakeMetrics.Received().RecordEvent( DeveloperEventType.Types.Type.VsiException, Arg.Is <DeveloperLogEvent>( p => ExceptionChainOverflowRecorded(p.ExceptionsData[0]))); }