Created
August 28, 2019 06:55
-
-
Save lawreyios/d8be0cf5813955a1bd24f6008a5acbe4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter_test/flutter_test.dart'; | |
| import 'package:tryunittesting/TextValidator.dart'; | |
| void main() { | |
| group('Given user is at Login Page', () { | |
| test( | |
| 'and user keys in username, username should be at least 8 characters long', | |
| () { | |
| expect(TextValidator().validateUsername('test'), false); | |
| expect(TextValidator().validateUsername('testtest'), true); | |
| }); | |
| test( | |
| 'and user keys in a password, password must have at least 1 minimum upper case, 1 minimum lower case, 1 numeric number, 1 special character and is at least 8 characters long', | |
| () { | |
| expect(TextValidator().validatePassword('test'), false); | |
| expect(TextValidator().validatePassword('Hh1@2222'), true); | |
| }); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment