Implemented the "copyFile(from: to: )" function for the FileService service in the library target.
This commit is contained in:
@@ -51,14 +51,14 @@ extension FileServiceMock: FileServicing {
|
||||
|
||||
// MARK: Functions
|
||||
|
||||
func copyItem(from source: URL, to destination: URL) async throws (FileServiceError) {
|
||||
func copyFile(from source: URL, to destination: URL) async throws (FileServiceError) {
|
||||
guard let nextAction else { return }
|
||||
|
||||
switch nextAction {
|
||||
case .error(let error):
|
||||
throw error
|
||||
case let .copyItem(source, destination):
|
||||
try await spy?.copyItem(from: source, to: destination)
|
||||
case let .copyFile(source, destination):
|
||||
try await spy?.copyFile(from: source, to: destination)
|
||||
default:
|
||||
break
|
||||
}
|
||||
@@ -126,7 +126,7 @@ private extension FileServiceMock {
|
||||
|
||||
extension FileServiceMock {
|
||||
enum Action {
|
||||
case copyItem(URL, URL)
|
||||
case copyFile(URL, URL)
|
||||
case createFolder(URL)
|
||||
case deleteItem(URL)
|
||||
case error(FileServiceError)
|
||||
|
||||
Reference in New Issue
Block a user