Skip to content

Commit 36d3989

Browse files
committed
Changes in OCRemoteFileDataSource unit tests
1 parent c2b3f0e commit 36d3989

3 files changed

Lines changed: 227 additions & 266 deletions

File tree

owncloudData/src/main/java/com/owncloud/android/data/files/datasources/implementation/OCRemoteFileDataSource.kt

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
package com.owncloud.android.data.files.datasources.implementation
2424

25+
import androidx.annotation.VisibleForTesting
2526
import com.owncloud.android.data.ClientManager
2627
import com.owncloud.android.data.executeRemoteOperation
2728
import com.owncloud.android.data.files.datasources.RemoteFileDataSource
@@ -202,23 +203,26 @@ class OCRemoteFileDataSource(
202203
)
203204
}
204205

205-
private fun RemoteFile.toModel(): OCFile =
206-
OCFile(
207-
owner = owner,
208-
remoteId = remoteId,
209-
remotePath = remotePath,
210-
length = if (isFolder) {
211-
size
212-
} else {
213-
length
214-
},
215-
creationTimestamp = creationTimestamp,
216-
modificationTimestamp = modifiedTimestamp,
217-
mimeType = mimeType,
218-
etag = etag,
219-
permissions = permissions,
220-
privateLink = privateLink,
221-
sharedWithSharee = sharedWithSharee,
222-
sharedByLink = sharedByLink,
223-
)
206+
companion object {
207+
@VisibleForTesting
208+
fun RemoteFile.toModel(): OCFile =
209+
OCFile(
210+
owner = owner,
211+
remoteId = remoteId,
212+
remotePath = remotePath,
213+
length = if (isFolder) {
214+
size
215+
} else {
216+
length
217+
},
218+
creationTimestamp = creationTimestamp,
219+
modificationTimestamp = modifiedTimestamp,
220+
mimeType = mimeType,
221+
etag = etag,
222+
permissions = permissions,
223+
privateLink = privateLink,
224+
sharedWithSharee = sharedWithSharee,
225+
sharedByLink = sharedByLink,
226+
)
227+
}
224228
}

0 commit comments

Comments
 (0)