Guest User

Untitled

a guest
Mar 23rd, 2018
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. override func setUp() {
  2. super.setUp()
  3. // Put setup code here. This method is called before the invocation of each test method in the class.
  4. }
  5.  
  6. override func tearDown() {
  7. // Put teardown code here. This method is called after the invocation of each test method in the class.
  8. super.tearDown()
  9. }
  10.  
  11. func test_Authentication_Positive() {
  12.  
  13. // given
  14. let authenticationExpectation = expectation(description: "Authentication")
  15. var authentication = Authentication()
  16. let params: [String: AnyObject] = [
  17. "userName": "user@abc.com" as AnyObject,
  18. "password": "User12345" as AnyObject ]
  19.  
  20. // when
  21. Authentication.auth(params: params, success: { (result) in
  22. authentication = result
  23. authenticationExpectation.fulfill()
  24. }, failure: { (error) in
  25. print(error)
  26. })
  27.  
  28. // then
  29. waitForExpectations(timeout: 2) { _ in
  30. XCTAssertNotNil(authentication)
  31. XCTAssertEqual(authentication.name, "Alaattin Bedir")
  32. }
  33.  
  34. }
Add Comment
Please, Sign In to add comment