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]. /// 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 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({ String shareText({
required String value, required String value,
required SharePlatform platform, required SharePlatform platform,

@ -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&quote=hello%20world!'; 'https://www.facebook.com/sharer.php?u=https%3A%2F%2Ffakeurl.com%2F&quote=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));
}); });
}); });
}); });

Loading…
Cancel
Save