Skip to content

Instantly share code, notes, and snippets.

@ktanaka117
Last active September 18, 2018 06:45
Show Gist options
  • Save ktanaka117/5ddf20f0b86cf45c319035077d2e1041 to your computer and use it in GitHub Desktop.
Save ktanaka117/5ddf20f0b86cf45c319035077d2e1041 to your computer and use it in GitHub Desktop.
import XCTest
import KeychainAccess
@testable import AwesomeIOSDC
class AuthDataStoreTests: XCTestCase {
let keychain = Keychain(service: Bundle.main.bundleIdentifier!) // ②
func testSaveAccessToken() {
let authDataStore = AuthDataStore() // ①
authDataStore.save(accessToken: "Congrats iOSDC "2018🎉") // ③, ④, ⑦
let sut = try! keychain.get("AccessToken") // ⑥
XCTAssertEqual("Congrats iOSDC 2018🎉", sut) // ④
// ⑤
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment