Created
February 5, 2019 10:44
-
-
Save avdyushin/fdc1a176b18539ab45cae159bbb75757 to your computer and use it in GitHub Desktop.
Unit Tests in Swift Playground
This file contains hidden or 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
class Tests: XCTestCase { | |
override func setUp() { | |
super.setUp() | |
} | |
override func tearDown() { | |
super.tearDown() | |
} | |
} | |
class TestObserver: NSObject, XCTestObservation { | |
func testCase(_ testCase: XCTestCase, | |
didFailWithDescription description: String, | |
inFile filePath: String?, | |
atLine lineNumber: Int) { | |
assertionFailure(description, line: UInt(lineNumber)) | |
} | |
} | |
let testObserver = TestObserver() | |
XCTestObservationCenter.shared.addTestObserver(testObserver) | |
Tests.defaultTestSuite.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment