-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from AgoraIO-Community/handle-rtm-flutter
RTM Flutter Handling
- Loading branch information
Showing
5 changed files
with
84 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// RtmUserIdHandlingTests.swift | ||
// | ||
// | ||
// Created by Max Cobb on 13/01/2023. | ||
// | ||
|
||
import XCTest | ||
import AgoraRtcKit | ||
@testable import AgoraUIKit | ||
|
||
final class RtmUserIdHandlingTests: XCTestCase { | ||
|
||
func testNegativeUID() throws { | ||
let userData = AgoraVideoViewer.UserData( | ||
rtmId: "example-test-rtm-id", rtcId: -512, | ||
role: AgoraClientRole.broadcaster.rawValue | ||
) | ||
XCTAssertEqual(userData.rtcId, -512, "UserData rtcId should be -512") | ||
XCTAssertEqual( | ||
userData.iOSUInt, 4294966784, | ||
"UserData iOSUInt should be 4294966784" | ||
) | ||
} | ||
|
||
func testLargeUID() throws { | ||
let userData = AgoraVideoViewer.UserData( | ||
rtmId: "example-test-rtm-id", rtcId: 4294966784, | ||
role: AgoraClientRole.broadcaster.rawValue | ||
) | ||
XCTAssertEqual( | ||
userData.rtcId, Int(userData.iOSUInt ?? 0), | ||
"UserData rtcId should be the same as iOSUInt" | ||
) | ||
} | ||
} |