Skip to content

Commit

Permalink
fix and uncomment tests
Browse files Browse the repository at this point in the history
  • Loading branch information
YehudaKremer committed Mar 16, 2022
1 parent 8e8b393 commit 457438e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions test/appxManifest_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ void main() {
var manifestContent =
await File('$tempFolderPath/AppxManifest.xml').readAsString();
expect(
manifestContent
.contains('<desktop:ExecutionAlias Alias="$testValue" />'),
manifestContent.contains(
'<desktop:ExecutionAlias Alias="${testValue.toLowerCase()}.exe" />'),
true);
});

Expand Down
66 changes: 33 additions & 33 deletions test/configuration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,37 +160,37 @@ msix_config:
});
});

// group('certificate:', () {
// test('exited certificate path with password', () async {
// const pfxTestPath = '$tempFolderPath/test.pfx';
// await File(pfxTestPath).create();
// await File(yamlTestPath).writeAsString(yamlContent +
// '''certificate_path: $pfxTestPath
// certificate_password: 1234''');
// await config.getConfigValues();
// expect(config.certificatePath, pfxTestPath);
// });

// test('invalid certificate path', () async {
// await File(yamlTestPath).writeAsString(
// yamlContent + 'certificate_path: $tempFolderPath/test123.pfx');
// await config.getConfigValues();
// await expectLater(
// config.validateConfigValues,
// throwsA(predicate((String error) =>
// error.contains('The file certificate not found in'))));
// });

// test('certificate without password', () async {
// const pfxTestPath = '$tempFolderPath/test.pfx';
// await File(pfxTestPath).create();
// await File(yamlTestPath)
// .writeAsString(yamlContent + 'certificate_path: $pfxTestPath');
// await config.getConfigValues();
// await expectLater(
// config.validateConfigValues,
// throwsA(predicate((String error) =>
// error.contains('Certificate password is empty'))));
// });
// });
group('certificate:', () {
test('exited certificate path with password', () async {
const pfxTestPath = '$tempFolderPath/test.pfx';
await File(pfxTestPath).create();
await File(yamlTestPath).writeAsString(yamlContent +
'''certificate_path: $pfxTestPath
certificate_password: 1234''');
await config.getConfigValues();
expect(config.certificatePath, pfxTestPath);
});

test('invalid certificate path', () async {
await File(yamlTestPath).writeAsString(
yamlContent + 'certificate_path: $tempFolderPath/test123.pfx');
await config.getConfigValues();
await expectLater(
config.validateConfigValues,
throwsA(predicate((String error) =>
error.contains('The file certificate not found in'))));
});

test('certificate without password', () async {
const pfxTestPath = '$tempFolderPath/test.pfx';
await File(pfxTestPath).create();
await File(yamlTestPath)
.writeAsString(yamlContent + 'certificate_path: $pfxTestPath');
await config.getConfigValues();
await expectLater(
config.validateConfigValues,
throwsA(predicate((String error) =>
error.contains('Certificate password is empty'))));
});
});
}

0 comments on commit 457438e

Please sign in to comment.