chore: renamed variables for new method name

pull/225/head
Jonathan Daniels 3 years ago committed by jonathandaniels-vgv
parent 84c3dda060
commit 6660622883

@ -14,8 +14,6 @@ class ShareRepository {
/// Returns a url to share the [value] on the given [platform].
///
/// The returned url can be opened using the [url_launcher](https://pub.dev/packages/url_launcher) package.
///
/// The [value] must have the score embedded.
String shareText({
required String value,
required SharePlatform platform,

@ -16,25 +16,25 @@ void main() {
});
group('shareText', () {
const shareText = 'hello world!';
const value = 'hello world!';
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!';
final shareScoreResult = shareRepository.shareText(
value: shareText,
final shareTextResult = shareRepository.shareText(
value: value,
platform: SharePlatform.twitter,
);
expect(shareScoreResult, equals(shareScoreUrl));
expect(shareTextResult, equals(shareTextUrl));
});
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&quote=hello%20world!';
final shareScoreResult = shareRepository.shareText(
value: shareText,
final shareTextResult = shareRepository.shareText(
value: value,
platform: SharePlatform.facebook,
);
expect(shareScoreResult, equals(shareScoreUrl));
expect(shareTextResult, equals(shareTextUrl));
});
});
});

Loading…
Cancel
Save