File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,6 @@ class ValidatorTests: XCTestCase {
4444
4545 let ERROR_LABEL = UILabel ( )
4646
47- let GREEN_COLOR = UIColor . greenColor ( )
48-
4947 override func setUp( ) {
5048 super. setUp ( )
5149 // Put setup code here. This method is called before the invocation of each test method in the class.
@@ -250,4 +248,13 @@ class ValidatorTests: XCTestCase {
250248 XCTAssert ( CGColorEqualToColor ( self . REGISTER_TXT_FIELD. layer. borderColor, UIColor . redColor ( ) . CGColor) , " Color should be what it was set as " )
251249 }
252250 }
251+
252+ func testTextFieldBorderColorNotSet( ) {
253+ REGISTER_VALIDATOR . registerField ( REGISTER_TXT_FIELD, errorLabel: ERROR_LABEL, rules: [ EmailRule ( ) ] )
254+ REGISTER_TXT_FIELD . text = INVALID_EMAIL
255+ REGISTER_VALIDATOR . validate { ( errors) -> Void in
256+ XCTAssert ( errors. count == 1 , " Should come back with errors " )
257+ XCTAssert ( !CGColorEqualToColor( self . REGISTER_TXT_FIELD. layer. borderColor, UIColor . redColor ( ) . CGColor) , " Color shouldn't get set at all " )
258+ }
259+ }
253260}
You can’t perform that action at this time.
0 commit comments