Skip to content

Commit 939d583

Browse files
test: Add assertions to testNSException (#6656)
Assert type and value for testNSException.
1 parent 2b0eac0 commit 939d583

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Tests/SentryTests/SentryCrashReportConverterTests.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,16 @@ - (void)testMissingUser
220220
- (void)testNSException
221221
{
222222
[self isValidReport:@"Resources/NSException"];
223+
224+
NSDictionary *rawCrash = [self getCrashReport:@"Resources/NSException"];
225+
SentryCrashReportConverter *reportConverter =
226+
[[SentryCrashReportConverter alloc] initWithReport:rawCrash inAppLogic:self.inAppLogic];
227+
SentryEvent *event = [reportConverter convertReportToEvent];
228+
229+
SentryException *exception = event.exceptions.firstObject;
230+
XCTAssertEqualObjects(exception.type, @"NSInvalidArgumentException");
231+
XCTAssertEqualObjects(exception.value,
232+
@"-[__NSArrayI objectForKey:]: unrecognized selector sent to instance 0x1e59bc50");
223233
}
224234

225235
- (void)testUnknownTypeException

0 commit comments

Comments
 (0)