Skip to content

Commit

Permalink
Fix: Remove unnecessary null-check operator
Browse files Browse the repository at this point in the history
  • Loading branch information
spnda committed Nov 9, 2022
1 parent d40c4cf commit 422dc84
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/mojang_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void main() async {
test('Test if the player can migrate', () async {
try {
if (user == null) return;
var migrate = await canMigrate(user!.accessToken);
var migrate = await canMigrate(user.accessToken);
print('The player can migrate: $migrate');
} on Error catch (e) {
print(e);
Expand All @@ -69,7 +69,7 @@ void main() async {
try {
if (user == null) return;
var valid =
await validate(user!.accessToken, clientToken: user!.clientToken);
await validate(user.accessToken, clientToken: user.clientToken);
expect(valid, isTrue);
} on Error catch (e) {
print(e);
Expand All @@ -79,7 +79,7 @@ void main() async {
test('Get user profile with authentication', () async {
try {
if (user == null) return;
final profile = await getCurrentProfile(user!.accessToken);
final profile = await getCurrentProfile(user.accessToken);
final skins = profile.getSkins;
expect(skins, isNotEmpty);
expect(skins.first.url, testData['skin_texture']);
Expand All @@ -91,20 +91,20 @@ void main() async {
var needed = false;
test('Check if security questions are required.', () async {
if (user == null) return;
needed = await areSecurityChallengesNeeded(user!.accessToken);
needed = await areSecurityChallengesNeeded(user.accessToken);
expect(needed, isNotNull);
});

test('Get security questions and answer them', () async {
if (user == null || !needed) return;
final challenges = await getSecurityChallenges(user!.accessToken);
final challenges = await getSecurityChallenges(user.accessToken);
expect(challenges, isList);
expect(challenges, hasLength(3)); // There should always be 3 challenges.
});

test('Get name change info', () async {
if (user == null) return;
final info = await getNameChangeInfo(user!.accessToken);
final info = await getNameChangeInfo(user.accessToken);
print(info.createdAt.toString());
});
});
Expand Down

0 comments on commit 422dc84

Please sign in to comment.