File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ class ValidatorTests: XCTestCase {
4444
4545 let ERROR_LABEL = UILabel ( )
4646
47+ let GREEN_COLOR = UIColor . greenColor ( )
48+
4749 override func setUp( ) {
4850 super. setUp ( )
4951 // Put setup code here. This method is called before the invocation of each test method in the class.
@@ -238,4 +240,14 @@ class ValidatorTests: XCTestCase {
238240 }
239241 }
240242 }
243+
244+ func testTextFieldBorderColorSet( ) {
245+ REGISTER_VALIDATOR . registerField ( REGISTER_TXT_FIELD, errorLabel: ERROR_LABEL, rules: [ EmailRule ( ) ] )
246+ REGISTER_TXT_FIELD . text = INVALID_EMAIL
247+ REGISTER_VALIDATOR . shouldMarkTextFieldsInError = true
248+ REGISTER_VALIDATOR . validate { ( errors) -> Void in
249+ XCTAssert ( errors. count == 1 , " Should come back with errors " )
250+ XCTAssert ( CGColorEqualToColor ( self . REGISTER_TXT_FIELD. layer. borderColor, UIColor . redColor ( ) . CGColor) , " Color should be what it was set as " )
251+ }
252+ }
241253}
You can’t perform that action at this time.
0 commit comments