Skip to content
Snippets Groups Projects
Verified Commit 3a88b04d authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Further tests

parent ae696d81
No related branches found
No related tags found
No related merge requests found
Showing
with 724 additions and 70 deletions
......@@ -47,16 +47,22 @@ open class BufferViewConfig(
?.mapNotNull { it.into<BufferId>() }
?.toSet()
.orEmpty(),
bufferViewName = properties["bufferViewName"].into(bufferViewName()),
networkId = properties["networkId"].into(networkId()),
addNewBuffersAutomatically = properties["addNewBuffersAutomatically"].into(addNewBuffersAutomatically()),
sortAlphabetically = properties["sortAlphabetically"].into(sortAlphabetically()),
hideInactiveBuffers = properties["hideInactiveBuffers"].into(hideInactiveBuffers()),
hideInactiveNetworks = properties["hideInactiveNetworks"].into(hideInactiveNetworks()),
disableDecoration = properties["disableDecoration"].into(disableDecoration()),
allowedBufferTypes = properties["allowedBufferTypes"].into(allowedBufferTypes()),
minimumActivity = properties["minimumActivity"].into(minimumActivity()),
showSearch = properties["showSearch"].into(showSearch()),
bufferViewName = properties["bufferViewName"].into(bufferViewName),
networkId = properties["networkId"].into(networkId),
addNewBuffersAutomatically = properties["addNewBuffersAutomatically"].into(addNewBuffersAutomatically),
sortAlphabetically = properties["sortAlphabetically"].into(sortAlphabetically),
hideInactiveBuffers = properties["hideInactiveBuffers"].into(hideInactiveBuffers),
hideInactiveNetworks = properties["hideInactiveNetworks"].into(hideInactiveNetworks),
disableDecoration = properties["disableDecoration"].into(disableDecoration),
allowedBufferTypes = properties["allowedBufferTypes"].into<Int>()
?.let(Int::toUShort)
?.let(BufferType.Companion::of)
?: allowedBufferTypes,
minimumActivity = properties["minimumActivity"].into<Int>()
?.let(Int::toUInt)
?.let(BufferActivity.Companion::of)
?: minimumActivity,
showSearch = properties["showSearch"].into(showSearch),
)
}
}
......
......@@ -44,17 +44,17 @@ open class Network(
copy(
networkName = properties["networkName"].into(networkName),
currentServer = properties["currentServer"].into(currentServer),
myNick = properties["myNick"].into(),
myNick = properties["myNick"].into(myNick),
latency = properties["latency"].into(latency),
codecForServer = StringSerializerUtf8.deserializeRaw(
properties["codecForServer"].into<ByteBuffer>()
),
codecForEncoding = StringSerializerUtf8.deserializeRaw(
properties["codecForEncoding"].into<ByteBuffer>()
),
codecForDecoding = StringSerializerUtf8.deserializeRaw(
properties["codecForDecoding"].into<ByteBuffer>()
),
codecForServer = properties["codecForServer"].into<ByteBuffer>()
?.let(StringSerializerUtf8::deserializeRaw)
?: codecForServer,
codecForEncoding = properties["codecForEncoding"].into<ByteBuffer>()
?.let(StringSerializerUtf8::deserializeRaw)
?: codecForServer,
codecForDecoding = properties["codecForDecoding"].into<ByteBuffer>()
?.let(StringSerializerUtf8::deserializeRaw)
?: codecForServer,
identity = properties["identityId"]
.into(identity),
connected = properties["isConnected"]
......@@ -356,11 +356,11 @@ open class Network(
if (properties.isNotEmpty()) {
channel.fromVariantMap(properties, index)
channel.initialized = true
}
session?.synchronize(channel)
state.update {
copy(ircChannels = ircChannels + Pair(caseMapper().toLowerCase(name), channel))
}
}
return channel
}
......@@ -421,7 +421,10 @@ open class Network(
override fun removeCap(capability: String) {
state.update {
copy(capsEnabled = capsEnabled - caseMapper().toLowerCase(capability))
copy(
caps = caps - caseMapper().toLowerCase(capability),
capsEnabled = capsEnabled - caseMapper().toLowerCase(capability),
)
}
super.removeCap(capability)
}
......
......@@ -119,29 +119,29 @@ data class NetworkState(
return Pair(defaultPrefixes, defaultPrefixModes)
} else if ((prefix.toSet() intersect defaultPrefixes.toSet()).isNotEmpty()) {
val (prefixes, prefixModes) = defaultPrefixes.zip(defaultPrefixModes)
.filter { prefix.contains(it.second) }
.filter { prefix.contains(it.first) }
.unzip()
return Pair(prefixModes, prefixes)
return Pair(prefixes, prefixModes)
} else if ((prefix.toSet() intersect defaultPrefixModes.toSet()).isNotEmpty()) {
val (prefixes, prefixModes) = defaultPrefixes.zip(defaultPrefixModes)
.filter { prefix.contains(it.first) }
.filter { prefix.contains(it.second) }
.unzip()
return Pair(prefixModes, prefixes)
return Pair(prefixes, prefixModes)
}
return Pair(defaultPrefixes, defaultPrefixModes)
}
private fun determineChannelModeTypes(): Map<ChannelModeType, Set<Char>> {
return ChannelModeType.values()
.zip(
supportValue(IrcISupport.CHANMODES)
?.split(',', limit = ChannelModeType.values().size)
val groups = supportValue(IrcISupport.CHANMODES)
?.split(',')
?.map(String::toSet)
.orEmpty()
)
.toMap()
return ChannelModeType.values().withIndex().map { (index, key) ->
key to groups.getOrNull(index).orEmpty()
}.toMap()
}
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables
import de.justjanne.libquassel.protocol.syncables.state.BufferViewConfigState
import de.justjanne.libquassel.protocol.testutil.nextBufferViewConfig
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import kotlin.random.Random
class BufferViewConfigTest {
@Test
fun testEmpty() {
val state = BufferViewConfigState(bufferViewId = 1)
val actual = BufferViewConfig(state = state).apply {
fromVariantMap(emptyMap())
}.state()
assertEquals(state, actual)
}
@Test
fun testSerialization() {
val random = Random(1337)
val expected = random.nextBufferViewConfig(bufferViewId = 1)
val actual = BufferViewConfig(
state = BufferViewConfigState(
bufferViewId = expected.bufferViewId,
)
).apply {
fromVariantMap(BufferViewConfig(state = expected).toVariantMap())
}.state()
assertEquals(expected, actual)
}
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables
import de.justjanne.libquassel.protocol.syncables.state.BufferViewManagerState
import de.justjanne.libquassel.protocol.testutil.nextBufferViewManager
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import kotlin.random.Random
class BufferViewManagerTest {
@Test
fun testEmpty() {
val state = BufferViewManagerState()
val actual = BufferViewManager(state = state).apply {
fromVariantMap(emptyMap())
}.state()
assertEquals(state, actual)
}
@Test
fun testSerialization() {
val random = Random(1337)
val expected = random.nextBufferViewManager()
val actual = BufferViewManager().apply {
fromVariantMap(BufferViewManager(state = expected).toVariantMap())
}.state()
assertEquals(expected, actual)
}
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables
import de.justjanne.libquassel.protocol.models.ids.NetworkId
import de.justjanne.libquassel.protocol.syncables.state.IrcChannelState
import de.justjanne.libquassel.protocol.testutil.nextIrcChannel
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import kotlin.random.Random
class IrcChannelTest {
@Test
fun testEmpty() {
val state = IrcChannelState(
network = NetworkId(1),
name = "#name"
)
val actual = IrcChannel(state = state).apply {
fromVariantMap(emptyMap())
}.state()
assertEquals(state, actual)
}
@Test
fun testSerialization() {
val random = Random(1337)
val expected = random.nextIrcChannel(NetworkId(random.nextInt()))
val actual = IrcChannel(
state = IrcChannelState(
network = expected.network,
name = expected.name,
)
).apply {
fromVariantMap(IrcChannel(state = expected).toVariantMap())
}.state()
assertEquals(expected, actual)
}
}
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.syncables
import de.justjanne.libquassel.protocol.models.ids.NetworkId
import de.justjanne.libquassel.protocol.syncables.state.IrcUserState
import de.justjanne.libquassel.protocol.testutil.nextIrcUser
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import kotlin.random.Random
class IrcUserTest {
@Test
fun testEmpty() {
val state = IrcUserState(
network = NetworkId(1),
nick = "nick",
user = "user",
host = "host"
)
val actual = IrcUser(state = state).apply {
fromVariantMap(emptyMap())
}.state()
assertEquals(state, actual)
}
@Test
fun testSerialization() {
val random = Random(1337)
val expected = random.nextIrcUser(NetworkId(random.nextInt()))
val actual = IrcUser(
state = IrcUserState(
network = expected.network,
nick = expected.nick,
user = expected.user,
host = expected.host
)
).apply {
fromVariantMap(IrcUser(state = expected).toVariantMap())
}.state()
assertEquals(expected, actual)
}
}
......@@ -10,13 +10,27 @@
package de.justjanne.libquassel.protocol.syncables
import de.justjanne.libquassel.protocol.models.ids.NetworkId
import de.justjanne.libquassel.protocol.models.network.ChannelModeType
import de.justjanne.libquassel.protocol.syncables.state.NetworkState
import de.justjanne.libquassel.protocol.testutil.nextNetwork
import de.justjanne.libquassel.protocol.testutil.nextString
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.Test
import kotlin.random.Random
import kotlin.test.assertNotEquals
class NetworkTest {
@Test
fun testEmpty() {
val state = NetworkState(networkId = NetworkId(1))
val actual = Network(state = state).apply {
fromVariantMap(emptyMap())
}.state()
assertEquals(state, actual)
}
@Test
fun testSerialization() {
val random = Random(1337)
......@@ -29,4 +43,406 @@ class NetworkTest {
assertEquals(expected, actual)
}
@Nested
inner class User {
@Test
fun addNew() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.ircUserCount()
assertNotEquals(0, sizeBefore)
network.addIrcUser(random.nextString())
assertEquals(sizeBefore + 1, network.ircUserCount())
}
@Test
fun addExisting() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
assertNotEquals(0, network.ircUserCount())
val existing = network.ircUsers().first()
assertEquals(existing, network.newIrcUser(existing.hostMask()))
}
@Test
fun removeExisting() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.ircUserCount()
assertNotEquals(0, sizeBefore)
network.removeIrcUser(network.ircUsers().first())
assertEquals(sizeBefore - 1, network.ircUserCount())
}
}
@Nested
inner class Channel {
@Test
fun addNew() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.ircChannelCount()
assertNotEquals(0, sizeBefore)
network.addIrcChannel(random.nextString())
assertEquals(sizeBefore + 1, network.ircChannelCount())
}
@Test
fun addExisting() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
assertNotEquals(0, network.ircUserCount())
val existing = network.ircChannels().first()
assertEquals(existing, network.newIrcChannel(existing.name()))
}
@Test
fun removeExisting() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.ircChannelCount()
assertNotEquals(0, sizeBefore)
network.removeIrcChannel(network.ircChannels().first())
assertEquals(sizeBefore - 1, network.ircChannelCount())
}
}
@Nested
inner class Support {
@Test
fun addNew() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.supports().size
assertNotEquals(0, sizeBefore)
network.addSupport(random.nextString(), random.nextString())
assertEquals(sizeBefore + 1, network.supports().size)
}
@Test
fun addExisting() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.supports().size
assertNotEquals(0, sizeBefore)
network.addSupport(network.supports().keys.first(), random.nextString())
assertEquals(sizeBefore, network.supports().size)
}
@Test
fun removeExisting() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.supports().size
assertNotEquals(0, sizeBefore)
network.removeSupport(network.supports().keys.first())
assertEquals(sizeBefore - 1, network.supports().size)
}
}
@Nested
inner class Capability {
@Test
fun addNew() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.caps().size
assertNotEquals(0, sizeBefore)
network.addCap(random.nextString(), random.nextString())
assertEquals(sizeBefore + 1, network.caps().size)
}
@Test
fun addExisting() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.caps().size
assertNotEquals(0, sizeBefore)
network.addCap(network.caps().keys.first(), random.nextString())
assertEquals(sizeBefore, network.caps().size)
}
@Test
fun acknowledgeNew() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.capsEnabled().size
assertNotEquals(0, sizeBefore)
network.acknowledgeCap(random.nextString())
assertEquals(sizeBefore + 1, network.capsEnabled().size)
}
@Test
fun acknowledgeExisting() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.capsEnabled().size
assertNotEquals(0, sizeBefore)
network.acknowledgeCap(network.capsEnabled().first())
assertEquals(sizeBefore, network.capsEnabled().size)
}
@Test
fun removeExisting() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.caps().size
assertNotEquals(0, sizeBefore)
network.removeCap(network.caps().keys.first())
assertEquals(sizeBefore - 1, network.caps().size)
}
@Test
fun clear() {
val random = Random(1337)
val network = Network(state = random.nextNetwork(networkId = NetworkId(random.nextInt())))
val sizeBefore = network.caps().size
assertNotEquals(0, sizeBefore)
network.clearCaps()
assertEquals(0, network.caps().size)
assertEquals(0, network.capsEnabled().size)
}
}
@Nested
inner class ChannelModes {
@Test
fun usual() {
val network = Network(
state = NetworkState(
networkId = NetworkId(1),
supports = mapOf(
"CHANMODES" to "eIbq,k,flj,CFLMPQScgimnprstuz"
)
)
)
assertEquals(
mapOf(
ChannelModeType.A_CHANMODE to setOf('e', 'I', 'b', 'q'),
ChannelModeType.B_CHANMODE to setOf('k'),
ChannelModeType.C_CHANMODE to setOf('f', 'l', 'j'),
ChannelModeType.D_CHANMODE to setOf(
'C', 'F', 'L', 'M', 'P', 'Q', 'S', 'c', 'g', 'i', 'm', 'n', 'p', 'r', 's', 't', 'u', 'z'
),
),
network.channelModes()
)
}
@Test
fun blank() {
val network = Network(
state = NetworkState(
networkId = NetworkId(1),
supports = mapOf(
"CHANMODES" to ""
)
)
)
assertEquals(
mapOf<ChannelModeType, Set<Char>>(
ChannelModeType.A_CHANMODE to emptySet(),
ChannelModeType.B_CHANMODE to emptySet(),
ChannelModeType.C_CHANMODE to emptySet(),
ChannelModeType.D_CHANMODE to emptySet(),
),
network.channelModes()
)
}
@Test
fun empty() {
val network = Network(
state = NetworkState(
networkId = NetworkId(1),
supports = emptyMap()
)
)
assertEquals(
mapOf<ChannelModeType, Set<Char>>(
ChannelModeType.A_CHANMODE to emptySet(),
ChannelModeType.B_CHANMODE to emptySet(),
ChannelModeType.C_CHANMODE to emptySet(),
ChannelModeType.D_CHANMODE to emptySet(),
),
network.channelModes()
)
}
@Test
fun wrongData() {
val network = Network(
state = NetworkState(
networkId = NetworkId(1),
supports = mapOf(
"CHANMODES" to "a,b,c,d,e"
)
)
)
assertEquals(
mapOf(
ChannelModeType.A_CHANMODE to setOf('a'),
ChannelModeType.B_CHANMODE to setOf('b'),
ChannelModeType.C_CHANMODE to setOf('c'),
ChannelModeType.D_CHANMODE to setOf('d'),
),
network.channelModes()
)
}
}
@Nested
inner class Prefixes {
@Test
fun usual() {
val network = Network(
state = NetworkState(
networkId = NetworkId(1),
supports = mapOf(
"PREFIX" to "(@+)ov"
)
)
)
assertEquals(
listOf('@', '+'),
network.prefixes()
)
assertEquals(
listOf('o', 'v'),
network.prefixModes()
)
}
@Test
fun wrongFormatting() {
val network = Network(
state = NetworkState(
networkId = NetworkId(1),
supports = mapOf(
"PREFIX" to "(@+]ov"
)
)
)
assertEquals(
listOf('@', '+'),
network.prefixes()
)
assertEquals(
listOf('o', 'v'),
network.prefixModes()
)
}
@Test
fun onlyPrefixes() {
val network = Network(
state = NetworkState(
networkId = NetworkId(1),
supports = mapOf(
"PREFIX" to "@+"
)
)
)
assertEquals(
listOf('@', '+'),
network.prefixes()
)
assertEquals(
listOf('o', 'v'),
network.prefixModes()
)
}
@Test
fun onlyModes() {
val network = Network(
state = NetworkState(
networkId = NetworkId(1),
supports = mapOf(
"PREFIX" to "ov"
)
)
)
assertEquals(
listOf('@', '+'),
network.prefixes()
)
assertEquals(
listOf('o', 'v'),
network.prefixModes()
)
}
@Test
fun blank() {
val network = Network(
state = NetworkState(
networkId = NetworkId(1),
supports = mapOf(
"PREFIX" to ""
)
)
)
assertEquals(
listOf('~', '&', '@', '%', '+'),
network.prefixes()
)
assertEquals(
listOf('q', 'a', 'o', 'h', 'v'),
network.prefixModes()
)
}
@Test
fun wrongContent() {
val network = Network(
state = NetworkState(
networkId = NetworkId(1),
supports = mapOf(
"PREFIX" to "12345"
)
)
)
assertEquals(
listOf('~', '&', '@', '%', '+'),
network.prefixes()
)
assertEquals(
listOf('q', 'a', 'o', 'h', 'v'),
network.prefixModes()
)
}
}
}
......@@ -9,16 +9,24 @@
package de.justjanne.libquassel.protocol.testutil
import de.justjanne.bitflags.of
import de.justjanne.libquassel.protocol.models.flags.BufferActivity
import de.justjanne.libquassel.protocol.models.flags.BufferType
import de.justjanne.libquassel.protocol.models.ids.BufferId
import de.justjanne.libquassel.protocol.models.ids.IdentityId
import de.justjanne.libquassel.protocol.models.ids.NetworkId
import de.justjanne.libquassel.protocol.models.network.NetworkServer
import de.justjanne.libquassel.protocol.syncables.BufferViewConfig
import de.justjanne.libquassel.protocol.syncables.IrcChannel
import de.justjanne.libquassel.protocol.syncables.IrcUser
import de.justjanne.libquassel.protocol.syncables.state.BufferViewConfigState
import de.justjanne.libquassel.protocol.syncables.state.BufferViewManagerState
import de.justjanne.libquassel.protocol.syncables.state.IrcChannelState
import de.justjanne.libquassel.protocol.syncables.state.IrcUserState
import de.justjanne.libquassel.protocol.syncables.state.NetworkState
import org.threeten.bp.Instant
import java.util.EnumSet
import java.util.Locale
import java.util.UUID
import kotlin.random.Random
import kotlin.random.nextUInt
......@@ -52,16 +60,20 @@ fun Random.nextNetwork(networkId: NetworkId) = NetworkState(
connected = nextBoolean(),
connectionState = nextEnum(),
ircUsers = List(nextInt(20)) {
nextIrcUser(networkId)
}.associateBy(IrcUser::nick),
IrcUser(state = nextIrcUser(networkId))
}.associateBy(IrcUser::nick).mapKeys { (key) ->
key.toLowerCase(Locale.ROOT)
},
ircChannels = List(nextInt(20)) {
nextIrcChannel(networkId)
}.associateBy(IrcChannel::name),
IrcChannel(state = nextIrcChannel(networkId))
}.associateBy(IrcChannel::name).mapKeys { (key) ->
key.toLowerCase(Locale.ROOT)
},
supports = List(nextInt(20)) {
nextString() to nextString()
nextString().toUpperCase(Locale.ROOT) to nextString()
}.toMap(),
caps = List(nextInt(20)) {
nextString() to nextString()
nextString().toLowerCase(Locale.ROOT) to nextString()
}.toMap(),
capsEnabled = List(nextInt(20)) {
nextString()
......@@ -109,8 +121,7 @@ fun Random.nextNetworkServer() = NetworkServer(
fun Random.nextIrcUser(
networkId: NetworkId = NetworkId(nextInt())
) = IrcUser(
state = IrcUserState(
) = IrcUserState(
network = networkId,
nick = nextString(),
user = nextString(),
......@@ -128,16 +139,48 @@ fun Random.nextIrcUser(
suserHost = nextString(),
encrypted = nextBoolean()
)
)
fun Random.nextIrcChannel(
networkId: NetworkId = NetworkId(nextInt())
) = IrcChannel(
state = IrcChannelState(
) = IrcChannelState(
network = networkId,
name = nextString(),
topic = nextString(),
password = nextString(),
encrypted = nextBoolean()
)
fun Random.nextBufferViewConfig(
bufferViewId: Int = nextInt()
) = BufferViewConfigState(
bufferViewId = bufferViewId,
bufferViewName = nextString(),
networkId = NetworkId(nextInt()),
addNewBuffersAutomatically = nextBoolean(),
sortAlphabetically = nextBoolean(),
hideInactiveNetworks = nextBoolean(),
hideInactiveBuffers = nextBoolean(),
disableDecoration = nextBoolean(),
allowedBufferTypes = BufferType.of(
List(nextInt(BufferType.values().size)) {
nextEnum()
}
),
minimumActivity = BufferActivity.of(nextEnum<BufferActivity>()),
showSearch = nextBoolean(),
buffers = List(nextInt(20)) {
BufferId(nextInt())
},
removedBuffers = List(nextInt(20)) {
BufferId(nextInt())
}.toSet(),
temporarilyRemovedBuffers = List(nextInt(20)) {
BufferId(nextInt())
}.toSet()
)
fun Random.nextBufferViewManager() = BufferViewManagerState(
bufferViewConfigs = List(nextInt(20)) {
BufferViewConfig(state = BufferViewConfigState(bufferViewId = nextInt()))
}.associateBy(BufferViewConfig::bufferViewId)
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment