File tree Expand file tree Collapse file tree
AnimalsApp/AnimalsAppTests/ExtensionsTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66//
77
88import XCTest
9+ @testable import AnimalsApp
910
1011class StringExtensionTests : XCTestCase {
1112
12- override func setUpWithError( ) throws {
13- // Put setup code here. This method is called before the invocation of each test method in the class.
13+ func testIfIsEmptyExtensionReturnsNil( ) {
14+ let emptyString = " "
15+ let result = emptyString. testIfIsEmpty ( )
16+
17+ XCTAssertNil ( result)
1418 }
15-
16- override func tearDownWithError( ) throws {
17- // Put teardown code here. This method is called after the invocation of each test method in the class.
18- }
19-
20- func testExample( ) throws {
21- // This is an example of a functional test case.
22- // Use XCTAssert and related functions to verify your tests produce the correct results.
23- // Any test you write for XCTest can be annotated as throws and async.
24- // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
25- // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
26- }
27-
28- func testPerformanceExample( ) throws {
29- // This is an example of a performance test case.
30- self . measure {
31- // Put the code you want to measure the time of here.
32- }
19+
20+ func testIfIsEmptyExtensionReturnsSelf( ) {
21+ let string = " string "
22+ let result = string. testIfIsEmpty ( )
23+
24+ XCTAssertEqual ( string, result)
3325 }
3426
3527}
You can’t perform that action at this time.
0 commit comments