mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-10 22:34:15 +01:00
util uses bitwise operations to access every single permission via variable Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
27 lines
1.0 KiB
Kotlin
27 lines
1.0 KiB
Kotlin
package com.nextcloud.talk.utils
|
|
|
|
import junit.framework.TestCase
|
|
import org.junit.Test
|
|
|
|
class AttendeePermissionsUtilTest : TestCase() {
|
|
|
|
@Test
|
|
fun test_areFlagsSet() {
|
|
val attendeePermissionsUtil = AttendeePermissionsUtil(
|
|
AttendeePermissionsUtil.PUBLISH_SCREEN
|
|
or AttendeePermissionsUtil.JOIN_CALL
|
|
or AttendeePermissionsUtil.DEFAULT)
|
|
|
|
assert(attendeePermissionsUtil.canPublishScreen)
|
|
assert(attendeePermissionsUtil.canJoinCall)
|
|
assert(attendeePermissionsUtil.isDefault) // if AttendeePermissionsUtil.DEFAULT is not set with setFlags and
|
|
// checked with assertFalse, the logic fails somehow?!
|
|
|
|
assertFalse(attendeePermissionsUtil.isCustom)
|
|
assertFalse(attendeePermissionsUtil.canStartCall)
|
|
assertFalse(attendeePermissionsUtil.canIgnoreLobby)
|
|
assertFalse(attendeePermissionsUtil.canPublishAudio)
|
|
assertFalse(attendeePermissionsUtil.canPublishVideo)
|
|
assertFalse(attendeePermissionsUtil.canPostChatShareItemsDoReaction)
|
|
}
|
|
} |