You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XCTAssert(errors.count ==1,"Should come back with errors")
229
-
iflet errorText =self.ERROR_LABEL.text {
230
-
XCTAssert(errorText ==errors[self.REGISTER_TXT_FIELD]!.errorMessage,"Shouldn't have an error message on the label, got: \(self.ERROR_LABEL.text!), expected: \(errors[self.REGISTER_TXT_FIELD]!.errorMessage)")
231
-
}else{
232
-
XCTAssert(false,"Error label should have text, not nil")
233
-
}
235
+
XCTAssert(errorCount ==1,"Should have called the error style transform once")
236
+
XCTAssert(successCount ==0,"Should not have called the success style transform as there are no successful fields")
XCTAssert(errors.count ==1,"Should come back with errors")
242
-
iflet errorText =self.ERROR_LABEL.text {
243
-
XCTAssert(errorText ==errors[self.REGISTER_TXT_FIELD]!.errorMessage,"Shouldn't have an error message on the label, got: \(self.ERROR_LABEL.text!), expected: \(errors[self.REGISTER_TXT_FIELD]!.errorMessage)")
244
-
245
-
self.REGISTER_TXT_FIELD.text =self.VALID_EMAIL
246
-
self.REGISTER_VALIDATOR.validate{(errors)->Voidin
247
-
XCTAssert(errors.count ==0,"Should not come back with errors")
248
-
XCTAssert(self.ERROR_LABEL.text ==nil,"Shouldn't have an error message on the label")
249
-
}
250
-
}else{
251
-
XCTAssert(false,"Error label should have text, not nil")
254
+
XCTAssert(errorCount ==1,"Should have called the error style transform once")
255
+
XCTAssert(successCount ==0,"Should not have called the success style transform as there are no successful fields")
256
+
self.REGISTER_TXT_FIELD.text =self.VALID_EMAIL
257
+
self.REGISTER_VALIDATOR.validate{(errors)->Voidin
258
+
XCTAssert(errors.count ==0,"Should not come back with errors: \(errors)")
259
+
XCTAssert(successCount ==1,"Should have called the success style transform once")
260
+
XCTAssert(errorCount ==1,"Should not have called the error style transform again")
0 commit comments