@@ -45,10 +45,10 @@ public void SetPassword_Succeeds()
45
45
Assert . False ( oathSession . IsPasswordProtected ) ;
46
46
47
47
IList < Credential > credentialList = oathSession . GetCredentials ( ) ;
48
- Assert . Equal ( 1 , credentialList . Count ) ;
48
+ _ = Assert . Single ( credentialList ) ;
49
49
50
50
Credential cred = credentialList [ 0 ] ;
51
- Assert . NotNull ( cred . Algorithm ) ;
51
+ _ = Assert . NotNull ( cred . Algorithm ) ;
52
52
if ( ! ( cred . Algorithm is null ) )
53
53
{
54
54
Assert . Equal ( HashAlgorithm . Sha256 , cred . Algorithm ) ;
@@ -65,7 +65,7 @@ public void SetPassword_Succeeds()
65
65
Assert . True ( oathSession . IsPasswordProtected ) ;
66
66
67
67
IList < Credential > credentialList = oathSession . GetCredentials ( ) ;
68
- Assert . Equal ( 1 , credentialList . Count ) ;
68
+ _ = Assert . Single ( credentialList ) ;
69
69
}
70
70
71
71
using ( var oathSession = new OathSession ( yubiKeyDevice ) )
@@ -84,10 +84,10 @@ public void SetPassword_Succeeds()
84
84
Assert . True ( isVerified ) ;
85
85
86
86
IList < Credential > credentialList = oathSession . GetCredentials ( ) ;
87
- Assert . Equal ( 1 , credentialList . Count ) ;
87
+ _ = Assert . Single ( credentialList ) ;
88
88
89
89
Credential cred = credentialList [ 0 ] ;
90
- Assert . NotNull ( cred . Algorithm ) ;
90
+ _ = Assert . NotNull ( cred . Algorithm ) ;
91
91
if ( ! ( cred . Algorithm is null ) )
92
92
{
93
93
Assert . Equal ( HashAlgorithm . Sha256 , cred . Algorithm ) ;
@@ -121,7 +121,7 @@ public void SetPassword_Succeeds()
121
121
Assert . False ( isSet ) ;
122
122
123
123
IList < Credential > credentialList = oathSession . GetCredentials ( ) ;
124
- Assert . Equal ( 1 , credentialList . Count ) ;
124
+ _ = Assert . Single ( credentialList ) ;
125
125
}
126
126
127
127
using ( var oathSession = new OathSession ( yubiKeyDevice ) )
@@ -138,7 +138,7 @@ public void SetPassword_Succeeds()
138
138
Assert . False ( isSet ) ;
139
139
140
140
IList < Credential > credentialList = oathSession . GetCredentials ( ) ;
141
- Assert . Equal ( 1 , credentialList . Count ) ;
141
+ _ = Assert . Single ( credentialList ) ;
142
142
143
143
oathSession . ResetApplication ( ) ;
144
144
}
@@ -184,16 +184,16 @@ public void UnsetPassword_Succeeds()
184
184
Assert . False ( oathSession . IsPasswordProtected ) ;
185
185
186
186
IList < Credential > credentialList = oathSession . GetCredentials ( ) ;
187
- Assert . Equal ( 1 , credentialList . Count ) ;
187
+ _ = Assert . Single ( credentialList ) ;
188
188
}
189
189
190
190
using ( var oathSession = new OathSession ( yubiKeyDevice ) )
191
191
{
192
192
IList < Credential > credentialList = oathSession . GetCredentials ( ) ;
193
- Assert . Equal ( 1 , credentialList . Count ) ;
193
+ _ = Assert . Single ( credentialList ) ;
194
194
195
195
Credential cred = credentialList [ 0 ] ;
196
- Assert . NotNull ( cred . Algorithm ) ;
196
+ _ = Assert . NotNull ( cred . Algorithm ) ;
197
197
if ( ! ( cred . Algorithm is null ) )
198
198
{
199
199
Assert . Equal ( HashAlgorithm . Sha256 , cred . Algorithm ) ;
@@ -295,16 +295,16 @@ public void VerifyPassword_UnsetNoCurrent_Succeeds()
295
295
Assert . False ( oathSession . IsPasswordProtected ) ;
296
296
297
297
IList < Credential > credentialList = oathSession . GetCredentials ( ) ;
298
- Assert . Equal ( 1 , credentialList . Count ) ;
298
+ _ = Assert . Single ( credentialList ) ;
299
299
}
300
300
301
301
using ( var oathSession = new OathSession ( yubiKeyDevice ) )
302
302
{
303
303
IList < Credential > credentialList = oathSession . GetCredentials ( ) ;
304
- Assert . Equal ( 1 , credentialList . Count ) ;
304
+ _ = Assert . Single ( credentialList ) ;
305
305
306
306
Credential cred = credentialList [ 0 ] ;
307
- Assert . NotNull ( cred . Algorithm ) ;
307
+ _ = Assert . NotNull ( cred . Algorithm ) ;
308
308
if ( ! ( cred . Algorithm is null ) )
309
309
{
310
310
Assert . Equal ( HashAlgorithm . Sha256 , cred . Algorithm ) ;
@@ -340,7 +340,7 @@ public void PasswordNotSet_Verify_ReturnsFalse()
340
340
Assert . False ( oathSession . IsPasswordProtected ) ;
341
341
342
342
IList < Credential > credentialList = oathSession . GetCredentials ( ) ;
343
- Assert . Equal ( 1 , credentialList . Count ) ;
343
+ _ = Assert . Single ( credentialList ) ;
344
344
345
345
oathSession . ResetApplication ( ) ;
346
346
}
0 commit comments