File tree Expand file tree Collapse file tree 2 files changed +7
-16
lines changed
Sources/ValidatorUI/Classes
Tests/ValidatorUITests/UnitTests Expand file tree Collapse file tree 2 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import ValidatorCore
88
99// MARK: - IUIValidatable
1010
11+ @MainActor
1112public protocol IUIValidatable : AnyObject {
1213 associatedtype Input
1314
Original file line number Diff line number Diff line change @@ -13,26 +13,13 @@ import XCTest
1313
1414#if os(iOS)
1515 final class UITextFieldTests : XCTestCase {
16- // MARK: Properties
17-
18- private var textField : UITextField !
19-
20- // MARK: XCTestCase
21-
22- override func setUp( ) {
23- super. setUp ( )
24- textField = UITextField ( )
25- }
26-
27- override func tearDown( ) {
28- textField = nil
29- super. tearDown ( )
30- }
31-
3216 // MARK: Tests
3317
18+ @MainActor
3419 func test_thatTextFieldValidationReturnsValid_whenInputValueIsValid( ) {
3520 // given
21+ let textField = UITextField ( )
22+
3623 textField. validateOnInputChange ( isEnabled: true )
3724 textField. add ( rule: LengthValidationRule ( max: . max, error: String . error) )
3825
@@ -49,8 +36,11 @@ import XCTest
4936 else { XCTFail ( " The result must be equal to the valid value " ) }
5037 }
5138
39+ @MainActor
5240 func test_thatTextFieldValidationReturnsInvalid_whenInputValueIsInvalid( ) {
5341 // given
42+ let textField = UITextField ( )
43+
5444 textField. validateOnInputChange ( isEnabled: true )
5545 textField. add ( rule: LengthValidationRule ( max: . max, error: String . error) )
5646
You can’t perform that action at this time.
0 commit comments