@@ -121,5 +121,41 @@ public void TestCorrectDictionaryGeneration_CreateCorrectAttributesDictionary_Wi
121121 Assert . IsTrue ( testObject . Attributes [ clientAttributeKey ] == clientAttributeValue ) ;
122122 Assert . IsTrue ( testObject . Attributes [ reportAttributeKey ] == reportAttributeValue ) ;
123123 }
124+
125+ [ Test ]
126+ public void TestExceptionTypeAttribute_ShouldSetExceptionTypeMessage_ExceptionTypeAttributeIsCorrect ( )
127+ {
128+ var report = new BacktraceReport ( "foo" ) ;
129+ var testAttributes = new BacktraceAttributes ( report , null ) ;
130+
131+ Assert . AreEqual ( "Message" , testAttributes . Attributes [ "error.type" ] ) ;
132+ }
133+
134+ [ Test ]
135+ public void TestExceptionTypeAttribute_ShouldSetExceptionTypeException_ExceptionTypeAttributeIsCorrect ( )
136+ {
137+ var report = new BacktraceReport ( new Exception ( "foo" ) ) ;
138+ var testAttributes = new BacktraceAttributes ( report , null ) ;
139+
140+ Assert . AreEqual ( "Exception" , testAttributes . Attributes [ "error.type" ] ) ;
141+ }
142+
143+ [ Test ]
144+ public void TestExceptionTypeAttribute_ShouldSetExceptionTypeUnhandledException_ExceptionTypeAttributeIsCorrect ( )
145+ {
146+ var report = new BacktraceReport ( new BacktraceUnhandledException ( "foo" , string . Empty ) ) ;
147+ var testAttributes = new BacktraceAttributes ( report , null ) ;
148+
149+ Assert . AreEqual ( "Unhandled exception" , testAttributes . Attributes [ "error.type" ] ) ;
150+ }
151+
152+ [ Test ]
153+ public void TestExceptionTypeAttribute_ShouldSetExceptionTypeHang_ExceptionTypeAttributeIsCorrect ( )
154+ {
155+ var report = new BacktraceReport ( new BacktraceUnhandledException ( "ANRException: Blocked thread detected" , string . Empty ) ) ;
156+ var testAttributes = new BacktraceAttributes ( report , null ) ;
157+
158+ Assert . AreEqual ( "Hang" , testAttributes . Attributes [ "error.type" ] ) ;
159+ }
124160 }
125161}
0 commit comments