Guest User

Untitled

a guest
Dec 5th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. class When_Trying_To_Save_User : XCTestCase {
  2.  
  3. private var dataAccess :DataAccess!
  4.  
  5. override func setUp() {
  6. super.setUp()
  7.  
  8. self.dataAccess = DataAccess()
  9. }
  10.  
  11. func test_should_save_user_successfully() {
  12.  
  13. let user = User(username :"johndoe", password: "password")
  14. _ = self.dataAccess.saveUser(user)
  15.  
  16. // You can also get the user and compare the values of the username and password properties
  17. XCTAssertTrue(self.dataAccess.getUsers().count == 1)
  18. }
  19. }
Add Comment
Please, Sign In to add comment