|
|
@ -10,36 +10,30 @@ void main() {
|
|
|
|
shareRepository = ShareRepository();
|
|
|
|
shareRepository = ShareRepository();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
group('constructor', () {
|
|
|
|
test('can be instantiated', () {
|
|
|
|
test('creates new ShareRepository instance', () {
|
|
|
|
expect(ShareRepository(), isNotNull);
|
|
|
|
expect(ShareRepository(), isNotNull);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
group('shareScore', () {
|
|
|
|
group('shareScore', () {
|
|
|
|
const shareText = 'hello world!';
|
|
|
|
const shareText = 'hello world!';
|
|
|
|
test('returns the correct share url for twitter', () async {
|
|
|
|
test('returns the correct share url for twitter', () async {
|
|
|
|
expect(
|
|
|
|
const shareScoreUrl =
|
|
|
|
shareRepository.shareScore(
|
|
|
|
'https://twitter.com/intent/tweet?url=https%3A%2F%2Fashehwkdkdjruejdnensjsjdne.web.app%2F%23%2F&text=hello%20world!';
|
|
|
|
shareText: shareText,
|
|
|
|
final shareScoreResult = shareRepository.shareScore(
|
|
|
|
platform: SharePlatform.twitter,
|
|
|
|
shareText: shareText,
|
|
|
|
),
|
|
|
|
platform: SharePlatform.twitter,
|
|
|
|
equals(
|
|
|
|
|
|
|
|
'https://twitter.com/intent/tweet?url=https%3A%2F%2Fashehwkdkdjruejdnensjsjdne.web.app%2F%23%2F&text=hello%20world!',
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
expect(shareScoreResult, equals(shareScoreUrl));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
test('returns the correct share url for facebook', () async {
|
|
|
|
test('returns the correct share url for facebook', () async {
|
|
|
|
expect(
|
|
|
|
const shareScoreUrl =
|
|
|
|
shareRepository.shareScore(
|
|
|
|
'https://www.facebook.com/sharer.php?u=https%3A%2F%2Fashehwkdkdjruejdnensjsjdne.web.app%2F%23%2F"e=hello%20world!';
|
|
|
|
shareText: shareText,
|
|
|
|
final shareScoreResult = shareRepository.shareScore(
|
|
|
|
platform: SharePlatform.facebook,
|
|
|
|
shareText: shareText,
|
|
|
|
),
|
|
|
|
platform: SharePlatform.facebook,
|
|
|
|
equals(
|
|
|
|
|
|
|
|
'https://www.facebook.com/sharer.php?u=https%3A%2F%2Fashehwkdkdjruejdnensjsjdne.web.app%2F%23%2F"e=hello%20world!',
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
expect(shareScoreResult, equals(shareScoreUrl));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|