Created
December 3, 2017 12:31
-
-
Save azamsharp/c8e96e206d1000db28798ca1d5b96340 to your computer and use it in GitHub Desktop.
Saving Data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class When_Trying_To_Save_User : XCTestCase { | |
private var dataAccess :DataAccess! | |
override func setUp() { | |
super.setUp() | |
self.dataAccess = DataAccess() | |
} | |
func test_should_save_user_successfully() { | |
let user = User(username :"johndoe", password: "password") | |
_ = self.dataAccess.saveUser(user) | |
// You can also get the user and compare the values of the username and password properties | |
XCTAssertTrue(self.dataAccess.getUsers().count == 1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment