diff --git a/test/parser/custom_parser_test.dart b/test/parser/custom_parser_test.dart index b1bb6fb..b228fcd 100644 --- a/test/parser/custom_parser_test.dart +++ b/test/parser/custom_parser_test.dart @@ -11,6 +11,27 @@ void main() { const tvalidUsername = "twitter.com/ABC38_"; + group('super constructor', () { + test('should return a valid instance', () { + expect(parser, isNotNull); + }); + + test('should return a valid instance', () { + expect(parser, isA()); + }); + + test('should contain the right parameters', () { + expect(parser.service, "Custom"); + expect( + parser.hosts, + const ["*"], + ); + expect(parser.schemes, const ["https", "http", ""]); + expect(parser.pathSegments, const []); + expect(parser.queryParameters, const {}); + }); + }); + group('isValid', () { test('A valid URL should return true', () { expect(parser.isValid(tValidUrl), true); diff --git a/test/parser/github_parser_test.dart b/test/parser/github_parser_test.dart index b283a2c..82d5e49 100644 --- a/test/parser/github_parser_test.dart +++ b/test/parser/github_parser_test.dart @@ -11,6 +11,27 @@ void main() { const tvalidUsername = "ABC38_"; + group('super constructor', () { + test('should return a valid instance', () { + expect(parser, isNotNull); + }); + + test('should return a valid instance', () { + expect(parser, isA()); + }); + + test('should contain the right parameters', () { + expect(parser.service, "GitHub"); + expect( + parser.hosts, + const ["github.com", "www.github.com"], + ); + expect(parser.schemes, const ["https", "http", ""]); + expect(parser.pathSegments, const ["{user}"]); + expect(parser.queryParameters, const {}); + }); + }); + group('isValid', () { test('A valid URL should return true', () { expect(parser.isValid(tValidUrl), true); diff --git a/test/parser/gitlab_parser_test.dart b/test/parser/gitlab_parser_test.dart index 00d474d..0aa4d08 100644 --- a/test/parser/gitlab_parser_test.dart +++ b/test/parser/gitlab_parser_test.dart @@ -11,6 +11,27 @@ void main() { const tvalidUsername = "ABC38_"; + group('super constructor', () { + test('should return a valid instance', () { + expect(parser, isNotNull); + }); + + test('should return a valid instance', () { + expect(parser, isA()); + }); + + test('should contain the right parameters', () { + expect(parser.service, "GitLab"); + expect( + parser.hosts, + const ["gitlab.com", "www.gitlab.com"], + ); + expect(parser.schemes, const ["https", "http", ""]); + expect(parser.pathSegments, const ["{user}"]); + expect(parser.queryParameters, const {}); + }); + }); + group('isValid', () { test('A valid URL should return true', () { expect(parser.isValid(tValidUrl), true); diff --git a/test/parser/linkedin_parser_test.dart b/test/parser/linkedin_parser_test.dart index 7786f89..03969a5 100644 --- a/test/parser/linkedin_parser_test.dart +++ b/test/parser/linkedin_parser_test.dart @@ -11,6 +11,27 @@ void main() { const tvalidUsername = "ABC38_"; + group('super constructor', () { + test('should return a valid instance', () { + expect(parser, isNotNull); + }); + + test('should return a valid instance', () { + expect(parser, isA()); + }); + + test('should contain the right parameters', () { + expect(parser.service, "LinkedIn"); + expect( + parser.hosts, + const ["linkedin.com", "www.linkedin.com"], + ); + expect(parser.schemes, const ["https", "http", ""]); + expect(parser.pathSegments, const ["in", "{user}"]); + expect(parser.queryParameters, const {}); + }); + }); + group('isValid', () { test('A valid URL should return true', () { expect(parser.isValid(tValidUrl), true); diff --git a/test/parser/medium_parser_test.dart b/test/parser/medium_parser_test.dart index 8a67e44..3fa5ba0 100644 --- a/test/parser/medium_parser_test.dart +++ b/test/parser/medium_parser_test.dart @@ -12,6 +12,27 @@ void main() { const tvalidUsername = "rouxguillaume"; const tvalidUsername2 = "@rouxguillaume"; + group('super constructor', () { + test('should return a valid instance', () { + expect(parser, isNotNull); + }); + + test('should return a valid instance', () { + expect(parser, isA()); + }); + + test('should contain the right parameters', () { + expect(parser.service, "Medium"); + expect( + parser.hosts, + const ["medium.com", "{user}.medium.com", "www.medium.com"], + ); + expect(parser.schemes, const ["https", "http", ""]); + expect(parser.pathSegments, const ["{user}"]); + expect(parser.queryParameters, const {}); + }); + }); + group('isValid', () { test('A valid URL should return true', () { expect(parser.isValid(tValidUrl), true); diff --git a/test/parser/stack_overflow_parser_test.dart b/test/parser/stack_overflow_parser_test.dart index f38a970..cbb285d 100644 --- a/test/parser/stack_overflow_parser_test.dart +++ b/test/parser/stack_overflow_parser_test.dart @@ -11,6 +11,27 @@ void main() { const tInvalidUrl = 'https://stackoverflow.com/13923049'; const tvalidUsername = "13923049"; + group('super constructor', () { + test('should return a valid instance', () { + expect(parser, isNotNull); + }); + + test('should return a valid instance', () { + expect(parser, isA()); + }); + + test('should contain the right parameters', () { + expect(parser.service, 'Stack Overflow'); + expect( + parser.hosts, + const ["stackoverflow.com", "www.stackoverflow.com"], + ); + expect(parser.schemes, const ["https", "http", ""]); + expect(parser.pathSegments, const ["users", "{user}"]); + expect(parser.queryParameters, const {}); + }); + }); + group('isValid', () { test('A valid URL should return true', () { expect(parser.isValid(tValidUrl), true); diff --git a/test/parser/twitter_parser_test.dart b/test/parser/twitter_parser_test.dart index a53f915..aa22c2c 100644 --- a/test/parser/twitter_parser_test.dart +++ b/test/parser/twitter_parser_test.dart @@ -11,6 +11,24 @@ void main() { const tvalidUsername = "ABC38_"; + group('super constructor', () { + test('should return a valid instance', () { + expect(parser, isNotNull); + }); + + test('should return a valid instance', () { + expect(parser, isA()); + }); + + test('should contain the right parameters', () { + expect(parser.service, 'Twitter'); + expect(parser.hosts, const ["twitter.com", "www.twitter.com"]); + expect(parser.schemes, const ["https", "http", ""]); + expect(parser.pathSegments, const ["{user}"]); + expect(parser.queryParameters, const {}); + }); + }); + group('isValid', () { test('A valid URL should return true', () { expect(parser.isValid(tValidUrl), true);