-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IOS-6901: Update SDKNodesUpdateListenerRepository on node updates to …
…match MEGAGlobalDelegate (cherry picked from commit 4fc93ca)
- Loading branch information
1 parent
f2fd948
commit b758daf
Showing
3 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
MEGADataTests/Repos/SDKNodesUpdateListenerRepositoryTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import XCTest | ||
@testable import MEGA | ||
|
||
final class SDKNodesUpdateListenerRepositoryTests: XCTestCase { | ||
|
||
func testMEGAGlobalDelegateonNodesUpdate_shouldPassNodeEntitiesToUpdateHandler() { | ||
let mockSdk = MockSdk() | ||
let repo = SDKNodesUpdateListenerRepository(sdk: mockSdk) | ||
let nodes = [MockNode(handle: 1), | ||
MockNode(handle: 2)] | ||
let exp = expectation(description: "SDK onNodesUpdate pass to onNodesUpdateHandler") | ||
repo.onNodesUpdateHandler = { | ||
XCTAssertEqual($0, nodes.toNodeEntities()) | ||
exp.fulfill() | ||
} | ||
repo.onNodesUpdate(mockSdk, nodeList: MockNodeList(nodes: nodes)) | ||
wait(for: [exp], timeout: 0.5) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters