Skip to content

Commit 698dc63

Browse files
committed
Add AssistantRepositoryTests
Signed-off-by: alperozturk <[email protected]>
1 parent 20e9150 commit 698dc63

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Nextcloud Android client application
3+
*
4+
* @author Alper Ozturk
5+
* Copyright (C) 2024 Alper Ozturk
6+
* Copyright (C) 2024 Nextcloud GmbH
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Affero General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Affero General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Affero General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
package com.nextcloud.client.assistant
23+
24+
import com.nextcloud.client.account.UserAccountManagerImpl
25+
import com.nextcloud.operations.assistant.AssistantRepository
26+
import com.owncloud.android.AbstractOnServerIT
27+
import org.junit.Assert.assertTrue
28+
import org.junit.Before
29+
import org.junit.Test
30+
31+
class AssistantRepositoryTests: AbstractOnServerIT() {
32+
33+
private var sut: AssistantRepository? = null
34+
35+
@Before
36+
fun setup() {
37+
val userAccountManager = UserAccountManagerImpl.fromContext(targetContext)
38+
sut = AssistantRepository(userAccountManager.user, targetContext)
39+
}
40+
41+
@Test
42+
fun testGetTaskTypes() {
43+
assertTrue(sut?.getTaskTypes()?.ocs?.data?.types?.isNotEmpty() == true)
44+
}
45+
46+
@Test
47+
fun testGetTaskList() {
48+
assertTrue(sut?.getTaskList("assistant")?.ocs?.data?.types?.isNotEmpty() == true)
49+
}
50+
51+
52+
}

0 commit comments

Comments
 (0)