Skip to content

Commit

Permalink
added some tests to EqualTo
Browse files Browse the repository at this point in the history
  • Loading branch information
alusev committed Jan 2, 2017
1 parent b2370f3 commit 1fd68b1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions EGFormValidatorTests/ValidatorEqualToTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,19 @@ class ValidatorEqualToTests: XCTestCase {
textField1.text = "1234"
textField2.text = "1234"
XCTAssert(vc.validate(), "Fields are equal")

textField1.text = ""
textField2.text = nil
XCTAssert(vc.validate(), "Fields are equal")

textField1.text = "yy"
textField2.text = nil
XCTAssertFalse(vc.validate(), "Fields are not equal")

textField1.text = nil
textField2.text = "xx"
XCTAssertFalse(vc.validate(), "Fields are not equal")

textField1.text = "1234"
textField2.text = "12345"
XCTAssertFalse(vc.validate(), "Fields arn't equal")
Expand Down Expand Up @@ -113,9 +121,9 @@ class ValidatorEqualToTests: XCTestCase {
customControl2.value = "A"
XCTAssertFalse(vc.validate(), "Fields are not equal")
}
}


}

class CustomControlFloat: UIView, Validatable {
var value: Float?
Expand Down

0 comments on commit 1fd68b1

Please sign in to comment.