Skip to content

Commit

Permalink
fix swiftlint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxxfrazer committed Jan 13, 2023
1 parent 150f6be commit f326ff4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Tests/Agora-UIKit-Tests/RtmMessagingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class RtmMessagesTests: XCTestCase {

XCTAssert(rtmMessage.type == .text, "Message type should be .text")
guard let rawData = rtmMessage.text.data(using: .utf8),
let unencodedJSON = try! JSONSerialization.jsonObject(
let unencodedJSON = try? JSONSerialization.jsonObject(
with: rawData, options: []) as? [String: Any]
else {
return XCTFail("Could not unencode data")
Expand Down Expand Up @@ -60,13 +60,12 @@ final class RtmMessagesTests: XCTestCase {
XCTAssert(rtmMessage.type == .text, "Message type should be .text")

guard let rawData = rtmMessage.text.data(using: .utf8),
let unencodedJSON = try! JSONSerialization.jsonObject(
let unencodedJSON = try? JSONSerialization.jsonObject(
with: rawData, options: []) as? [String: Any]
else {
return XCTFail("Could not unencode data")
}


XCTAssertEqual((unencodedJSON["rtcId"] as? Int), userData.rtcId, "rtcId invalid!")
XCTAssertEqual((unencodedJSON["role"] as? Int), userData.role, "mute invalid!")
XCTAssertEqual((unencodedJSON["username"] as? String), userData.username, "device invalid!")
Expand Down

0 comments on commit f326ff4

Please sign in to comment.