You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
990 B

6 years ago
6 years ago
  1. //
  2. // KeychainText.swift
  3. // GMERemittanceTests
  4. //
  5. // Created by InKwon Devik Kim on 08/04/2019.
  6. // Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import XCTest
  9. import KeychainAccess
  10. @testable import GME_Remit
  11. class KeychainTest: XCTestCase {
  12. func testSave(){
  13. KeyChain.shared.save(data: "ubrai13@gmail.com", key: .email)
  14. KeyChain.shared.save(data: "111111", key: .password)
  15. KeyChain.shared.save(data: "0", key: .biometricAuth)
  16. }
  17. func testFetch(){
  18. XCTAssert(KeyChain.shared.get(key: .email) == "ubrai13@gmail.com")
  19. XCTAssert(KeyChain.shared.get(key: .password) == "111111")
  20. XCTAssert(KeyChain.shared.get(key: .biometricAuth) == "0")
  21. }
  22. func testRemove(){
  23. KeyChain.shared.remove(key: .biometricAuth)
  24. KeyChain.shared.remove(key: .email)
  25. KeyChain.shared.remove(key: .password)
  26. }
  27. func testRemoveAll(){
  28. KeyChain.shared.removeAll()
  29. }
  30. }