Skip to content

Instantly share code, notes, and snippets.

@lawreyios
Created August 28, 2019 06:55
Show Gist options
  • Select an option

  • Save lawreyios/d8be0cf5813955a1bd24f6008a5acbe4 to your computer and use it in GitHub Desktop.

Select an option

Save lawreyios/d8be0cf5813955a1bd24f6008a5acbe4 to your computer and use it in GitHub Desktop.
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