Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 68b8877

Browse files
theScrabiabelgardep
authored andcommitted
apply changes acording to review
1 parent ce9fc3f commit 68b8877

File tree

1 file changed

+4
-46
lines changed
  • owncloudComLibrary/src/test/java/com/owncloud/android/lib/resources/shares/responses

1 file changed

+4
-46
lines changed

owncloudComLibrary/src/test/java/com/owncloud/android/lib/resources/shares/responses/ShareeResponseTest.kt

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import com.owncloud.android.lib.resources.CommonOcsResponse
2828
import com.squareup.moshi.JsonAdapter
2929
import com.squareup.moshi.Moshi
3030
import com.squareup.moshi.Types
31-
import org.junit.Assert.assertNotNull
3231
import org.junit.Assert.assertNull
3332
import org.junit.Assert.assertEquals
3433
import org.junit.Assert.assertTrue
@@ -62,56 +61,15 @@ class ShareeResponseTest {
6261
}
6362

6463
@Test
65-
fun `check structure - ok - contains exact`() {
66-
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
67-
assertNotNull(response.ocs.data.exact)
68-
}
69-
70-
@Test
71-
fun `check structure - ok - contains groups`() {
72-
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
73-
assertNotNull(response.ocs.data.groups)
74-
}
75-
76-
@Test
77-
fun `check structure - ok - contains remotes`() {
78-
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
79-
assertNotNull(response.ocs.data.remotes)
80-
}
81-
82-
@Test
83-
fun `check structure - ok - contains users`() {
84-
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
85-
assertNotNull(response.ocs.data.users)
86-
}
87-
88-
@Test
89-
fun `check structure - ok - groups contains two items`() {
64+
fun `example response - ok - correct sturcture`() {
9065
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
9166
assertEquals(2, response.ocs.data.groups.size)
92-
}
93-
94-
@Test
95-
fun `check structure - ok - users contains two items`() {
96-
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
67+
assertEquals(0, response.ocs.data.remotes.size)
9768
assertEquals(2, response.ocs.data.users.size)
98-
}
99-
100-
@Test
101-
fun `check structure - ok - exact_users contains one item`() {
102-
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
69+
assertEquals(0, response.ocs.data.exact?.groups?.size)
70+
assertEquals(0, response.ocs.data.exact?.remotes?.size)
10371
assertEquals(1, response.ocs.data.exact?.users?.size)
104-
}
105-
106-
@Test
107-
fun `check structure - ok - user1 contains additional data`() {
108-
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
10972
assertEquals("[email protected]", response.ocs.data.users.get(0).value.additionalInfo)
110-
}
111-
112-
@Test
113-
fun `check structure - ok - user2 does not contain additional data`() {
114-
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
11573
assertNull(response.ocs.data.users[1].value.additionalInfo)
11674
}
11775

0 commit comments

Comments
 (0)