Last active
September 18, 2018 07:05
-
-
Save ktanaka117/c56649d9bd1eada7dc35d363d4401501 to your computer and use it in GitHub Desktop.
This file contains 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
import XCTest | |
import KeychainAccess | |
@testable import AwesomeIOSDC | |
class AuthDataStoreTests: XCTestCase { | |
private let testAccessToken = "TestAccessToken" | |
private let accessTokenKey = "AccessToken" | |
private let keychain = Keychain(service: "TestService") | |
func testSaveAccessToken() { | |
let authDataStore = AuthDataStore(keychain: keychain) | |
authDataStore.save(accessToken: testAccessToken) | |
let sut = try! keychain.get(accessTokenKey) | |
XCTAssertEqual(testAccessToken, sut) | |
} | |
override func tearDown() { | |
super.tearDown() | |
keychain.set(nil, key: accessTokenKey) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment