Skip to content

Commit

Permalink
more tests added
Browse files Browse the repository at this point in the history
  • Loading branch information
mayckonx committed Apr 21, 2019
1 parent 3680eb5 commit e8af4d2
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions MBSPasswordViewTests/Classes/MBSPasswordViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,28 @@ class MBSPasswordViewTests: XCTestCase {
}
}

func testShakeView() {
let kind = MBSPasswordView.deviceBiometricsKind()
let biometricsOfDevice = LAContext().biometryType
switch biometricsOfDevice {
case .faceID:
XCTAssertEqual(kind, .faceID)
case .touchID:
XCTAssertEqual(kind, .touchID)
case .none:
XCTAssertEqual(kind, .none)
}
func testSelected() {
mbsPasswordView.selected("a")
let value = mbsPasswordView.topView.passwordValues[0]
XCTAssertEqual(value, "a")
}

func testRemoveLast() {
mbsPasswordView.selected("a")
mbsPasswordView.selected("b")
mbsPasswordView.selected("c")
mbsPasswordView.removeLast()

let count = mbsPasswordView.topView.passwordValues.count
XCTAssertEqual(count, 2)

mbsPasswordView.removeLast()
let oneCount = mbsPasswordView.topView.passwordValues.count
XCTAssertEqual(oneCount, 1)

mbsPasswordView.removeLast()
let zeroCount = mbsPasswordView.topView.passwordValues.count
XCTAssertEqual(zeroCount, 0)
}

// MARK: - Test properties initialization and assignments
Expand Down

0 comments on commit e8af4d2

Please sign in to comment.