@@ -7,7 +7,7 @@ void main() {
77 TestWidgetsFlutterBinding .ensureInitialized ();
88
99 String defaultPublicKey = 'PUBLIC_KEY' ;
10- String defaultEncrptedValue = 'ENCRYPTED -XX' ;
10+ String defaultEncrptedValue = 'SIGNED -XX' ;
1111 group (
1212 'Cipher' ,
1313 () {
@@ -61,29 +61,29 @@ void main() {
6161 });
6262
6363 test (
64- 'should return a valid encrypted data from platform' ,
64+ 'should return a valid signed data from platform' ,
6565 () async {
6666 // when
67- final String encrypted = await Cipher .encrypt ('some data' );
67+ final String signed = await Cipher .sign ('some data' );
6868
6969 // then
70- expect (encrypted , 'ENCRYPTED -XX' );
70+ expect (signed , 'SIGNED -XX' );
7171 },
7272 );
7373
7474 test (
7575 'should return single line value when multiline value is returned' ,
7676 () async {
7777 // given
78- defaultEncrptedValue = 'encryptedLine1 '
79- 'encryptedLine2 \n encryptedLine3 ' ;
78+ defaultEncrptedValue = 'signedLine1 '
79+ 'signedLine2 \n signedLine3 ' ;
8080 expect (defaultPublicKey.contains ('\n ' ), true );
8181
8282 // when
83- final String encrypted = await Cipher .encrypt ('some data' );
83+ final String signed = await Cipher .sign ('some data' );
8484
8585 // then
86- expect (encrypted , 'encryptedLine1encryptedLine2encryptedLine3 ' );
86+ expect (signed , 'signedLine1signedLine2signedLine3 ' );
8787 },
8888 );
8989 test (
@@ -108,7 +108,7 @@ void main() {
108108 (MethodCall methodCall) async {
109109 if (methodCall.method == 'getPublicKey' ) {
110110 throw Exception ('Error getting public key' );
111- } else if (methodCall.method == 'encrypt ' ) {
111+ } else if (methodCall.method == 'sign ' ) {
112112 throw Exception ('Error getting public key' );
113113 } else if (methodCall.method == 'verify' ) {
114114 throw Exception ('Error in verifying' );
@@ -135,17 +135,17 @@ void main() {
135135 );
136136
137137 test (
138- 'should throw exception when platform cannot encrypt data' ,
138+ 'should throw exception when platform cannot sign data' ,
139139 () async {
140140 try {
141141 // when
142- await Cipher .encrypt (null );
142+ await Cipher .sign (null );
143143 } catch (exception) {
144144 // then
145145 expect (exception.runtimeType, PlatformException );
146- expect (exception.code, 'CIPHER:ENCRYPT ' );
146+ expect (exception.code, 'CIPHER:SIGN ' );
147147 expect (exception.message,
148- ExceptionMessageConstant .encryptionFailed );
148+ ExceptionMessageConstant .signingFailed );
149149 }
150150 },
151151 );
@@ -164,7 +164,7 @@ void main() {
164164 }
165165 },
166166 );
167- },
167+ }
168168 );
169169 },
170170 );
0 commit comments