-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes buffers not being added in the correct position, adds tests
- Loading branch information
Showing
4 changed files
with
93 additions
and
6 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
54 changes: 54 additions & 0 deletions
54
lib/src/test/java/de/kuschku/libquassel/integration/BufferViewConfigTest.kt
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,54 @@ | ||
/* | ||
* Quasseldroid - Quassel client for Android | ||
* | ||
* Copyright (c) 2019 Janne Mareike Koschinski | ||
* Copyright (c) 2019 The Quassel Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 3 as published | ||
* by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package de.kuschku.libquassel.integration | ||
|
||
import de.kuschku.libquassel.protocol.BufferId | ||
import de.kuschku.libquassel.protocol.QType | ||
import de.kuschku.libquassel.protocol.QVariant_ | ||
import de.kuschku.libquassel.protocol.Type | ||
import de.kuschku.libquassel.util.TestSession | ||
import de.kuschku.libquassel.util.setupTestSession | ||
import de.kuschku.libquassel.util.with | ||
import org.junit.Before | ||
import org.junit.Test | ||
|
||
class BufferViewConfigTest { | ||
lateinit var session: TestSession | ||
|
||
@Before | ||
fun setUp() { | ||
session = setupTestSession() | ||
} | ||
|
||
// Test positioning of added channel | ||
@Test | ||
fun addChannelAutomatically() = session.with { | ||
val bufferViewConfig = bufferViewManager.bufferViewConfig(0)!! | ||
|
||
ensure { | ||
bufferViewConfig.insertBufferSorted(bufferSyncer.bufferInfo(BufferId(4))!!, bufferSyncer) | ||
}.does { | ||
callSync(bufferViewConfig, "requestAddBuffer", listOf( | ||
QVariant_.of(BufferId(4), QType.BufferId), | ||
QVariant_.of(2, Type.Int) | ||
)) | ||
} | ||
} | ||
} |
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