Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
Merge branch 'feature/add_unit_test' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
TesteurManiak committed Feb 25, 2022
2 parents a88a761 + 3b5d221 commit c40fbc0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
## 0.0.1
## 0.1.0

* TODO: Describe initial release.
* Added `CustomParser`
* Added `CustomParser.parse`
40 changes: 40 additions & 0 deletions test/parser/url_parser_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import 'package:fl_business_card_core/fl_business_card_core.dart';
import 'package:fl_business_card_core/src/models/url_parse_exceptions.dart';
import 'package:test/test.dart';

const _tService = 'a';
const _tHosts = ['a.com', 'a.net'];

class MockParserA extends UrlParser {
const MockParserA() : super(service: _tService, hosts: _tHosts);
}

class MockParserB extends UrlParser {
const MockParserB() : super(service: _tService, hosts: _tHosts);
}

void main() {
group('UrlParser', () {
group('props', () {
const tParserA = MockParserA();
const tParserB = MockParserA();

test('2 objects with same props are equal', () {
expect(tParserA.props, equals(tParserB.props));
expect(tParserA, equals(tParserB));
});
});

group('recoverUser', () {
const tParser = MockParserA();
const tUriString = '';

test('throws a UrlParseException if no valid url is found', () {
expect(
() => tParser.recoverUser(tUriString),
throwsA(isA<UrlParseException>()),
);
});
});
});
}

0 comments on commit c40fbc0

Please sign in to comment.