test: 新增对 BotAccount.id 字段的单元测试.

该测试有助于确保 id 能正常地从 Token 中获取.
This commit is contained in:
LamGC 2022-06-15 02:22:58 +08:00
parent 508f14f271
commit c5fe96c02d
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

View File

@ -16,6 +16,12 @@ import kotlin.test.assertTrue
internal class BotAccountTest {
@Test
fun `id getter`() {
val accountId = abs(Random().nextInt()).toLong()
assertEquals(accountId, BotAccount("Test", "${accountId}:AAHErDroUTznQsOd_oZPJ6cQEj4Z5mGHO10", 0).id)
}
@Test
fun deserializerTest() {
val accountId = abs(Random().nextInt()).toLong()