Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. func testPerformanceExample() {
  2. // This is an example of a performance test case.
  3. self.measure {
  4. // Put the code you want to measure the time of here.
  5. }
  6. }
  7. func testTitle() {
  8. let storyboard = UIStoryboard(name: "Main", bundle: nil)
  9. let vc = storyboard.instantiateInitialViewController() as! ViewController
  10. vc.viewDidLoad()
  11.  
  12. XCTAssertEqual("HELLO TEST", vc.title)
  13. }
  14.  
  15. func testTextField() {
  16. let storyboard = UIStoryboard(name: "Main", bundle: nil)
  17. let vc = storyboard.instantiateInitialViewController() as! ViewController
  18. vc.viewDidLoad()
  19.  
  20. XCTAssertEqual("ANOTHER TEST", vc.testTextField.placeholder)
  21. }
  22.  
  23. func testVowels(){
  24. let storyboard = UIStoryboard(name: "Main", bundle: nil)
  25. let vc = storyboard.instantiateInitialViewController() as! ViewController
  26. vc.viewDidLoad()
  27.  
  28.  
  29. XCTAssertEqual(1, vc.vowelsInAString(string: "Bomb"))
  30. XCTAssertEqual(5, vc.vowelsInAString(string: "murcielago"))
  31. }
  32.  
  33. func testConvertTitle() {
  34. let storyboard = UIStoryboard(name: "Main", bundle: nil)
  35. let vc = storyboard.instantiateInitialViewController() as! ViewController
  36. vc.viewDidLoad()
  37.  
  38. XCTAssertEqual("This Is A Test", vc.makeTitle(string: "this is a test"))
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement