Advertisement
Guest User

Untitled

a guest
Jan 19th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. //
  2. // atnowUserTest.swift
  3. // atnow-iOS
  4. //
  5. // Created by Ben Ribovich on 1/19/16.
  6. // Copyright © 2016 Parse. All rights reserved.
  7. //
  8.  
  9. import XCTest
  10. import Parse
  11.  
  12. class atnowUserTest: XCTestCase {
  13. let email = "testUser@dartmouth.edu"
  14. let password = "password"
  15. var user : PFUser?
  16.  
  17. override func setUp() {
  18. super.setUp()
  19. // Put setup code here. This method is called before the invocation of each test method in the class.
  20. user = PFUser()
  21. user?.username=email
  22. user?.email = email
  23. user?.password = password
  24.  
  25. }
  26.  
  27. override func tearDown() {
  28. // Put teardown code here. This method is called after the invocation of each test method in the class.
  29. super.tearDown()
  30. PFUser.currentUser()?.deleteInBackground()
  31. }
  32.  
  33. func testCreate() {
  34. // Creates a user
  35. user!.signUpInBackgroundWithBlock({ (succeed, error) -> Void in
  36. XCTAssert(succeed)
  37.  
  38. })
  39.  
  40. }
  41.  
  42. func testLogin() {
  43. // Logs a user in
  44. PFUser.logInWithUsernameInBackground(user!.email!, password: user!
  45.  
  46. .password!, block: { (user, error) -> Void in
  47.  
  48. })
  49. XCTAssert(PFUser.currentUser()?.email==email)
  50.  
  51. }
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement