Skip to content

Commit

Permalink
chore: address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
shafqat-muneer committed Jun 11, 2024
1 parent d99abee commit 6696577
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 74 deletions.
20 changes: 10 additions & 10 deletions Authorization/AuthorizationTests/AuthorizationMock.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2405,9 +2405,9 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
return __value
}

open func removeAppSupportDirectoryDeprecatedContent() {
addInvocation(.m_removeAppSupportDirectoryDeprecatedContent)
let perform = methodPerformValue(.m_removeAppSupportDirectoryDeprecatedContent) as? () -> Void
open func removeAppSupportDirectoryUnusedContent() {
addInvocation(.m_removeAppSupportDirectoryUnusedContent)
let perform = methodPerformValue(.m_removeAppSupportDirectoryUnusedContent) as? () -> Void
perform?()
}

Expand All @@ -2427,7 +2427,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
case m_fileUrl__for_blockId(Parameter<String>)
case m_resumeDownloading
case m_isLargeVideosSize__blocks_blocks(Parameter<[CourseBlock]>)
case m_removeAppSupportDirectoryDeprecatedContent
case m_removeAppSupportDirectoryUnusedContent
case p_currentDownloadTask_get

static func compareParameters(lhs: MethodType, rhs: MethodType, matcher: Matcher) -> Matcher.ComparisonResult {
Expand Down Expand Up @@ -2485,7 +2485,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsBlocks, rhs: rhsBlocks, with: matcher), lhsBlocks, rhsBlocks, "blocks"))
return Matcher.ComparisonResult(results)

case (.m_removeAppSupportDirectoryDeprecatedContent, .m_removeAppSupportDirectoryDeprecatedContent): return .match
case (.m_removeAppSupportDirectoryUnusedContent, .m_removeAppSupportDirectoryUnusedContent): return .match
case (.p_currentDownloadTask_get,.p_currentDownloadTask_get): return Matcher.ComparisonResult.match
default: return .none
}
Expand All @@ -2507,7 +2507,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
case let .m_fileUrl__for_blockId(p0): return p0.intValue
case .m_resumeDownloading: return 0
case let .m_isLargeVideosSize__blocks_blocks(p0): return p0.intValue
case .m_removeAppSupportDirectoryDeprecatedContent: return 0
case .m_removeAppSupportDirectoryUnusedContent: return 0
case .p_currentDownloadTask_get: return 0
}
}
Expand All @@ -2527,7 +2527,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
case .m_fileUrl__for_blockId: return ".fileUrl(for:)"
case .m_resumeDownloading: return ".resumeDownloading()"
case .m_isLargeVideosSize__blocks_blocks: return ".isLargeVideosSize(blocks:)"
case .m_removeAppSupportDirectoryDeprecatedContent: return ".removeAppSupportDirectoryDeprecatedContent()"
case .m_removeAppSupportDirectoryUnusedContent: return ".removeAppSupportDirectoryUnusedContent()"
case .p_currentDownloadTask_get: return "[get] .currentDownloadTask"
}
}
Expand Down Expand Up @@ -2684,7 +2684,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
public static func fileUrl(for blockId: Parameter<String>) -> Verify { return Verify(method: .m_fileUrl__for_blockId(`blockId`))}
public static func resumeDownloading() -> Verify { return Verify(method: .m_resumeDownloading)}
public static func isLargeVideosSize(blocks: Parameter<[CourseBlock]>) -> Verify { return Verify(method: .m_isLargeVideosSize__blocks_blocks(`blocks`))}
public static func removeAppSupportDirectoryDeprecatedContent() -> Verify { return Verify(method: .m_removeAppSupportDirectoryDeprecatedContent)}
public static func removeAppSupportDirectoryUnusedContent() -> Verify { return Verify(method: .m_removeAppSupportDirectoryUnusedContent)}
public static var currentDownloadTask: Verify { return Verify(method: .p_currentDownloadTask_get) }
}

Expand Down Expand Up @@ -2734,8 +2734,8 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
public static func isLargeVideosSize(blocks: Parameter<[CourseBlock]>, perform: @escaping ([CourseBlock]) -> Void) -> Perform {
return Perform(method: .m_isLargeVideosSize__blocks_blocks(`blocks`), performs: perform)
}
public static func removeAppSupportDirectoryDeprecatedContent(perform: @escaping () -> Void) -> Perform {
return Perform(method: .m_removeAppSupportDirectoryDeprecatedContent, performs: perform)
public static func removeAppSupportDirectoryUnusedContent(perform: @escaping () -> Void) -> Perform {
return Perform(method: .m_removeAppSupportDirectoryUnusedContent, performs: perform)
}
}

Expand Down
14 changes: 7 additions & 7 deletions Core/Core/Network/DownloadManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public protocol DownloadManagerProtocol {
func fileUrl(for blockId: String) -> URL?
func isLargeVideosSize(blocks: [CourseBlock]) -> Bool

func removeAppSupportDirectoryDeprecatedContent()
func removeAppSupportDirectoryUnusedContent()
}

public enum DownloadManagerEvent {
Expand Down Expand Up @@ -473,7 +473,7 @@ public class DownloadManager: DownloadManagerProtocol {
}
}

public func removeAppSupportDirectoryDeprecatedContent() {
public func removeAppSupportDirectoryUnusedContent() {
deleteMD5HashedFolders()
}

Expand All @@ -488,7 +488,7 @@ public class DownloadManager: DownloadManagerProtocol {
)
return appSupportDirectory
} catch {
print("Error getting Application Support Directory: \(error)")
debugPrint("Error getting Application Support Directory: \(error)")
return nil
}
}
Expand Down Expand Up @@ -516,14 +516,14 @@ public class DownloadManager: DownloadManagerProtocol {
if isMD5Hash(folderName) {
do {
try fileManager.removeItem(at: folderURL)
print("Deleted folder: \(folderName)")
debugPrint("Deleted folder: \(folderName)")
} catch {
print("Error deleting folder \(folderName): \(error)")
debugPrint("Error deleting folder \(folderName): \(error)")
}
}
}
} catch {
print("Error reading contents of Application Support directory: \(error)")
debugPrint("Error reading contents of Application Support directory: \(error)")
}
}
}
Expand Down Expand Up @@ -694,7 +694,7 @@ public class DownloadManagerMock: DownloadManagerProtocol {
false
}

public func removeAppSupportDirectoryDeprecatedContent() {
public func removeAppSupportDirectoryUnusedContent() {

}
}
Expand Down
20 changes: 10 additions & 10 deletions Course/CourseTests/CourseMock.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2831,9 +2831,9 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
return __value
}

open func removeAppSupportDirectoryDeprecatedContent() {
addInvocation(.m_removeAppSupportDirectoryDeprecatedContent)
let perform = methodPerformValue(.m_removeAppSupportDirectoryDeprecatedContent) as? () -> Void
open func removeAppSupportDirectoryUnusedContent() {
addInvocation(.m_removeAppSupportDirectoryUnusedContent)
let perform = methodPerformValue(.m_removeAppSupportDirectoryUnusedContent) as? () -> Void
perform?()
}

Expand All @@ -2853,7 +2853,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
case m_fileUrl__for_blockId(Parameter<String>)
case m_resumeDownloading
case m_isLargeVideosSize__blocks_blocks(Parameter<[CourseBlock]>)
case m_removeAppSupportDirectoryDeprecatedContent
case m_removeAppSupportDirectoryUnusedContent
case p_currentDownloadTask_get

static func compareParameters(lhs: MethodType, rhs: MethodType, matcher: Matcher) -> Matcher.ComparisonResult {
Expand Down Expand Up @@ -2911,7 +2911,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsBlocks, rhs: rhsBlocks, with: matcher), lhsBlocks, rhsBlocks, "blocks"))
return Matcher.ComparisonResult(results)

case (.m_removeAppSupportDirectoryDeprecatedContent, .m_removeAppSupportDirectoryDeprecatedContent): return .match
case (.m_removeAppSupportDirectoryUnusedContent, .m_removeAppSupportDirectoryUnusedContent): return .match
case (.p_currentDownloadTask_get,.p_currentDownloadTask_get): return Matcher.ComparisonResult.match
default: return .none
}
Expand All @@ -2933,7 +2933,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
case let .m_fileUrl__for_blockId(p0): return p0.intValue
case .m_resumeDownloading: return 0
case let .m_isLargeVideosSize__blocks_blocks(p0): return p0.intValue
case .m_removeAppSupportDirectoryDeprecatedContent: return 0
case .m_removeAppSupportDirectoryUnusedContent: return 0
case .p_currentDownloadTask_get: return 0
}
}
Expand All @@ -2953,7 +2953,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
case .m_fileUrl__for_blockId: return ".fileUrl(for:)"
case .m_resumeDownloading: return ".resumeDownloading()"
case .m_isLargeVideosSize__blocks_blocks: return ".isLargeVideosSize(blocks:)"
case .m_removeAppSupportDirectoryDeprecatedContent: return ".removeAppSupportDirectoryDeprecatedContent()"
case .m_removeAppSupportDirectoryUnusedContent: return ".removeAppSupportDirectoryUnusedContent()"
case .p_currentDownloadTask_get: return "[get] .currentDownloadTask"
}
}
Expand Down Expand Up @@ -3110,7 +3110,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
public static func fileUrl(for blockId: Parameter<String>) -> Verify { return Verify(method: .m_fileUrl__for_blockId(`blockId`))}
public static func resumeDownloading() -> Verify { return Verify(method: .m_resumeDownloading)}
public static func isLargeVideosSize(blocks: Parameter<[CourseBlock]>) -> Verify { return Verify(method: .m_isLargeVideosSize__blocks_blocks(`blocks`))}
public static func removeAppSupportDirectoryDeprecatedContent() -> Verify { return Verify(method: .m_removeAppSupportDirectoryDeprecatedContent)}
public static func removeAppSupportDirectoryUnusedContent() -> Verify { return Verify(method: .m_removeAppSupportDirectoryUnusedContent)}
public static var currentDownloadTask: Verify { return Verify(method: .p_currentDownloadTask_get) }
}

Expand Down Expand Up @@ -3160,8 +3160,8 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
public static func isLargeVideosSize(blocks: Parameter<[CourseBlock]>, perform: @escaping ([CourseBlock]) -> Void) -> Perform {
return Perform(method: .m_isLargeVideosSize__blocks_blocks(`blocks`), performs: perform)
}
public static func removeAppSupportDirectoryDeprecatedContent(perform: @escaping () -> Void) -> Perform {
return Perform(method: .m_removeAppSupportDirectoryDeprecatedContent, performs: perform)
public static func removeAppSupportDirectoryUnusedContent(perform: @escaping () -> Void) -> Perform {
return Perform(method: .m_removeAppSupportDirectoryUnusedContent, performs: perform)
}
}

Expand Down
20 changes: 10 additions & 10 deletions Dashboard/DashboardTests/DashboardMock.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2144,9 +2144,9 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
return __value
}

open func removeAppSupportDirectoryDeprecatedContent() {
addInvocation(.m_removeAppSupportDirectoryDeprecatedContent)
let perform = methodPerformValue(.m_removeAppSupportDirectoryDeprecatedContent) as? () -> Void
open func removeAppSupportDirectoryUnusedContent() {
addInvocation(.m_removeAppSupportDirectoryUnusedContent)
let perform = methodPerformValue(.m_removeAppSupportDirectoryUnusedContent) as? () -> Void
perform?()
}

Expand All @@ -2166,7 +2166,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
case m_fileUrl__for_blockId(Parameter<String>)
case m_resumeDownloading
case m_isLargeVideosSize__blocks_blocks(Parameter<[CourseBlock]>)
case m_removeAppSupportDirectoryDeprecatedContent
case m_removeAppSupportDirectoryUnusedContent
case p_currentDownloadTask_get

static func compareParameters(lhs: MethodType, rhs: MethodType, matcher: Matcher) -> Matcher.ComparisonResult {
Expand Down Expand Up @@ -2224,7 +2224,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
results.append(Matcher.ParameterComparisonResult(Parameter.compare(lhs: lhsBlocks, rhs: rhsBlocks, with: matcher), lhsBlocks, rhsBlocks, "blocks"))
return Matcher.ComparisonResult(results)

case (.m_removeAppSupportDirectoryDeprecatedContent, .m_removeAppSupportDirectoryDeprecatedContent): return .match
case (.m_removeAppSupportDirectoryUnusedContent, .m_removeAppSupportDirectoryUnusedContent): return .match
case (.p_currentDownloadTask_get,.p_currentDownloadTask_get): return Matcher.ComparisonResult.match
default: return .none
}
Expand All @@ -2246,7 +2246,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
case let .m_fileUrl__for_blockId(p0): return p0.intValue
case .m_resumeDownloading: return 0
case let .m_isLargeVideosSize__blocks_blocks(p0): return p0.intValue
case .m_removeAppSupportDirectoryDeprecatedContent: return 0
case .m_removeAppSupportDirectoryUnusedContent: return 0
case .p_currentDownloadTask_get: return 0
}
}
Expand All @@ -2266,7 +2266,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
case .m_fileUrl__for_blockId: return ".fileUrl(for:)"
case .m_resumeDownloading: return ".resumeDownloading()"
case .m_isLargeVideosSize__blocks_blocks: return ".isLargeVideosSize(blocks:)"
case .m_removeAppSupportDirectoryDeprecatedContent: return ".removeAppSupportDirectoryDeprecatedContent()"
case .m_removeAppSupportDirectoryUnusedContent: return ".removeAppSupportDirectoryUnusedContent()"
case .p_currentDownloadTask_get: return "[get] .currentDownloadTask"
}
}
Expand Down Expand Up @@ -2423,7 +2423,7 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
public static func fileUrl(for blockId: Parameter<String>) -> Verify { return Verify(method: .m_fileUrl__for_blockId(`blockId`))}
public static func resumeDownloading() -> Verify { return Verify(method: .m_resumeDownloading)}
public static func isLargeVideosSize(blocks: Parameter<[CourseBlock]>) -> Verify { return Verify(method: .m_isLargeVideosSize__blocks_blocks(`blocks`))}
public static func removeAppSupportDirectoryDeprecatedContent() -> Verify { return Verify(method: .m_removeAppSupportDirectoryDeprecatedContent)}
public static func removeAppSupportDirectoryUnusedContent() -> Verify { return Verify(method: .m_removeAppSupportDirectoryUnusedContent)}
public static var currentDownloadTask: Verify { return Verify(method: .p_currentDownloadTask_get) }
}

Expand Down Expand Up @@ -2473,8 +2473,8 @@ open class DownloadManagerProtocolMock: DownloadManagerProtocol, Mock {
public static func isLargeVideosSize(blocks: Parameter<[CourseBlock]>, perform: @escaping ([CourseBlock]) -> Void) -> Perform {
return Perform(method: .m_isLargeVideosSize__blocks_blocks(`blocks`), performs: perform)
}
public static func removeAppSupportDirectoryDeprecatedContent(perform: @escaping () -> Void) -> Perform {
return Perform(method: .m_removeAppSupportDirectoryDeprecatedContent, performs: perform)
public static func removeAppSupportDirectoryUnusedContent(perform: @escaping () -> Void) -> Perform {
return Perform(method: .m_removeAppSupportDirectoryUnusedContent, performs: perform)
}
}

Expand Down
Loading

0 comments on commit 6696577

Please sign in to comment.