|
|
@ -16,25 +16,25 @@ void main() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
group('shareText', () {
|
|
|
|
group('shareText', () {
|
|
|
|
const shareText = 'hello world!';
|
|
|
|
const value = 'hello world!';
|
|
|
|
test('returns the correct share url for twitter', () async {
|
|
|
|
test('returns the correct share url for twitter', () async {
|
|
|
|
const shareScoreUrl =
|
|
|
|
const shareTextUrl =
|
|
|
|
'https://twitter.com/intent/tweet?url=https%3A%2F%2Ffakeurl.com%2F&text=hello%20world!';
|
|
|
|
'https://twitter.com/intent/tweet?url=https%3A%2F%2Ffakeurl.com%2F&text=hello%20world!';
|
|
|
|
final shareScoreResult = shareRepository.shareText(
|
|
|
|
final shareTextResult = shareRepository.shareText(
|
|
|
|
value: shareText,
|
|
|
|
value: value,
|
|
|
|
platform: SharePlatform.twitter,
|
|
|
|
platform: SharePlatform.twitter,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
expect(shareScoreResult, equals(shareScoreUrl));
|
|
|
|
expect(shareTextResult, equals(shareTextUrl));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
test('returns the correct share url for facebook', () async {
|
|
|
|
test('returns the correct share url for facebook', () async {
|
|
|
|
const shareScoreUrl =
|
|
|
|
const shareTextUrl =
|
|
|
|
'https://www.facebook.com/sharer.php?u=https%3A%2F%2Ffakeurl.com%2F"e=hello%20world!';
|
|
|
|
'https://www.facebook.com/sharer.php?u=https%3A%2F%2Ffakeurl.com%2F"e=hello%20world!';
|
|
|
|
final shareScoreResult = shareRepository.shareText(
|
|
|
|
final shareTextResult = shareRepository.shareText(
|
|
|
|
value: shareText,
|
|
|
|
value: value,
|
|
|
|
platform: SharePlatform.facebook,
|
|
|
|
platform: SharePlatform.facebook,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
expect(shareScoreResult, equals(shareScoreUrl));
|
|
|
|
expect(shareTextResult, equals(shareTextUrl));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|