Skip to content

Commit

Permalink
Add tests for #74
Browse files Browse the repository at this point in the history
  • Loading branch information
devxoul committed Sep 7, 2019
1 parent 0bb1b52 commit 87bcf03
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Tests/ThenTests/ThenTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extension User: Then {}

class ThenTests: XCTestCase {

func testThen() {
func testThen_NSObject() {
let queue = OperationQueue().then {
$0.name = "awesome"
$0.maxConcurrentOperationCount = 5
Expand All @@ -35,6 +35,18 @@ class ThenTests: XCTestCase {
XCTAssertEqual(user.email, "devxoul@gmail.com")
}

func testWith_Array() {
let array = [1, 2, 3].with { $0.append(4) }
XCTAssertEqual(array, [1, 2, 3, 4])
}

func testWith_Dictionary() {
let dict = ["Korea": "Seoul", "Japan": "Tokyo"].with {
$0["China"] = "Beijing"
}
XCTAssertEqual(dict, ["Korea": "Seoul", "Japan": "Tokyo", "China": "Beijing"])
}

func testDo() {
UserDefaults.standard.do {
$0.removeObject(forKey: "username")
Expand Down

0 comments on commit 87bcf03

Please sign in to comment.