-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: add CollectionBinderDataSource tests
- Loading branch information
1 parent
cd1488c
commit 3529fe9
Showing
7 changed files
with
86 additions
and
1 deletion.
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
35 changes: 35 additions & 0 deletions
35
Example/Tests/BinderDataSource/CollectionBinderDataSourceTests.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,35 @@ | ||
// | ||
// CollectionDataSourceTests.swift | ||
// PowerTools_Tests | ||
// | ||
// Created by Andrea Altea on 22/05/2019. | ||
// Copyright © 2019 CocoaPods. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
import PowerTools | ||
|
||
class CollectionBinderDataSourceTests: XCTestCase { | ||
|
||
var collection: UICollectionView! | ||
var dataSource: CollectionBinderDataSource! | ||
|
||
override func setUp() { | ||
collection = UICollectionView(frame: CGRect(origin: .zero, size: CGSize(width: 320, height: 640)), | ||
collectionViewLayout: UICollectionViewLayout()) | ||
dataSource = CollectionBinderDataSource(view: collection, model: []) | ||
} | ||
|
||
override func tearDown() { | ||
dataSource = nil | ||
collection = nil | ||
} | ||
|
||
func testDataSourceSetup() { | ||
XCTAssert(dataSource == collection.dataSource as? CollectionBinderDataSource) | ||
let newCollection = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewLayout()) | ||
dataSource.view = newCollection | ||
XCTAssert(dataSource == newCollection.dataSource as? CollectionBinderDataSource) | ||
XCTAssert(collection.dataSource == nil) | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
Example/Tests/BinderDataSource/GridDataSource/GridDataSourceInteractionDelegateTests.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,33 @@ | ||
// | ||
// GridDataSourceInteractionDelegate.swift | ||
// PowerTools_Tests | ||
// | ||
// Created by Andrea Altea on 22/05/2019. | ||
// Copyright © 2019 CocoaPods. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
|
||
class GridDataSourceInteractionDelegate: XCTestCase { | ||
|
||
override func setUp() { | ||
// Put setup code here. This method is called before the invocation of each test method in the class. | ||
} | ||
|
||
override func tearDown() { | ||
// Put teardown code here. This method is called after the invocation of each test method in the class. | ||
} | ||
|
||
func testExample() { | ||
// This is an example of a functional test case. | ||
// Use XCTAssert and related functions to verify your tests produce the correct results. | ||
} | ||
|
||
func testPerformanceExample() { | ||
// This is an example of a performance test case. | ||
self.measure { | ||
// Put the code you want to measure the time of here. | ||
} | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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