mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-08 00:16:09 +00:00
apply changes acording to review
This commit is contained in:
parent
ce9fc3f189
commit
68b88775e6
@ -28,7 +28,6 @@ import com.owncloud.android.lib.resources.CommonOcsResponse
|
|||||||
import com.squareup.moshi.JsonAdapter
|
import com.squareup.moshi.JsonAdapter
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.Types
|
import com.squareup.moshi.Types
|
||||||
import org.junit.Assert.assertNotNull
|
|
||||||
import org.junit.Assert.assertNull
|
import org.junit.Assert.assertNull
|
||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
import org.junit.Assert.assertTrue
|
import org.junit.Assert.assertTrue
|
||||||
@ -62,56 +61,15 @@ class ShareeResponseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `check structure - ok - contains exact`() {
|
fun `example response - ok - correct sturcture`() {
|
||||||
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
|
|
||||||
assertNotNull(response.ocs.data.exact)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun `check structure - ok - contains groups`() {
|
|
||||||
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
|
|
||||||
assertNotNull(response.ocs.data.groups)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun `check structure - ok - contains remotes`() {
|
|
||||||
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
|
|
||||||
assertNotNull(response.ocs.data.remotes)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun `check structure - ok - contains users`() {
|
|
||||||
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
|
|
||||||
assertNotNull(response.ocs.data.users)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun `check structure - ok - groups contains two items`() {
|
|
||||||
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
|
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
|
||||||
assertEquals(2, response.ocs.data.groups.size)
|
assertEquals(2, response.ocs.data.groups.size)
|
||||||
}
|
assertEquals(0, response.ocs.data.remotes.size)
|
||||||
|
|
||||||
@Test
|
|
||||||
fun `check structure - ok - users contains two items`() {
|
|
||||||
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
|
|
||||||
assertEquals(2, response.ocs.data.users.size)
|
assertEquals(2, response.ocs.data.users.size)
|
||||||
}
|
assertEquals(0, response.ocs.data.exact?.groups?.size)
|
||||||
|
assertEquals(0, response.ocs.data.exact?.remotes?.size)
|
||||||
@Test
|
|
||||||
fun `check structure - ok - exact_users contains one item`() {
|
|
||||||
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
|
|
||||||
assertEquals(1, response.ocs.data.exact?.users?.size)
|
assertEquals(1, response.ocs.data.exact?.users?.size)
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun `check structure - ok - user1 contains additional data`() {
|
|
||||||
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
|
|
||||||
assertEquals("user1@user1.com", response.ocs.data.users.get(0).value.additionalInfo)
|
assertEquals("user1@user1.com", response.ocs.data.users.get(0).value.additionalInfo)
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun `check structure - ok - user2 does not contain additional data`() {
|
|
||||||
val response = loadResponses(EXAMPLE_RESPONSE_JSON)!!
|
|
||||||
assertNull(response.ocs.data.users[1].value.additionalInfo)
|
assertNull(response.ocs.data.users[1].value.additionalInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user