From 457438eb0eefc74e81f983120a13cf33357e5365 Mon Sep 17 00:00:00 2001 From: Yehuda Kremer Date: Wed, 16 Mar 2022 13:20:38 +0200 Subject: [PATCH] fix and uncomment tests --- test/appxManifest_test.dart | 4 +-- test/configuration_test.dart | 66 ++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/test/appxManifest_test.dart b/test/appxManifest_test.dart index 9e925ed..2b17f12 100644 --- a/test/appxManifest_test.dart +++ b/test/appxManifest_test.dart @@ -149,8 +149,8 @@ void main() { var manifestContent = await File('$tempFolderPath/AppxManifest.xml').readAsString(); expect( - manifestContent - .contains(''), + manifestContent.contains( + ''), true); }); diff --git a/test/configuration_test.dart b/test/configuration_test.dart index edb18a9..e2f51d4 100644 --- a/test/configuration_test.dart +++ b/test/configuration_test.dart @@ -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')))); + }); + }); }