Skip to content

Commit

Permalink
improved tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed Jan 19, 2021
1 parent 0910315 commit 8c80db8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Tests/XCTestExtensionsTests/XCTestExtensionsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,26 @@ final class XCTestExtensionsTests: XCTestCase {

let ok1 = ExampleResult.success(1)

XCTAssertSuccess(ok1) {
XCTAssertEqual($0, 1)
}

XCTAssertEqual(ok1, ExampleResult.success(1))
XCTAssertNotEqual(ok1, ExampleResult.success(2))
XCTAssertNotEqual(ok1, ExampleResult.failure(ExampleError()))

let failed = ExampleResult.failure(ExampleError())

XCTAssertFailure(failed) {
XCTAssertTrue($0 is ExampleError)
}
XCTAssertEqual(failed, ExampleResult.failure(ExampleError()))
XCTAssertNotEqual(failed, ExampleResult.failure(NSError(domain: "test", code: 123, userInfo: [:]) ))
XCTAssertNotEqual(failed, ExampleResult.success(1))

}

func testCollections() {
XCTAssertEmpty([])
}
}
2 changes: 2 additions & 0 deletions Tests/XCTestExtensionsTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ extension XCTestExtensionsTests {
("testFlags", testFlags),
("testProductsDirectory", testProductsDirectory),
("testResources", testResources),
("testResults", testResults),
("testTemporaryFile", testTemporaryFile),
("testTestBundle", testTestBundle),
("testTestBundleName", testTestBundleName),
]
}

Expand Down

0 comments on commit 8c80db8

Please sign in to comment.