@@ -79,9 +79,10 @@ public void Invoke_CommandApduWithoutData_InvokesNextTransformWithSameApdu()
79
79
_ = transform . Invoke ( commandApdu , typeof ( object ) , typeof ( object ) ) ;
80
80
81
81
// Assert
82
- mockTransform . Verify (
83
- x =>
84
- x . Invoke ( Arg . Is < CommandApdu > ( a => a == commandApdu ) , Arg . Any < Type > ( ) , Arg . Any < Type > ( ) ) ) ;
82
+ mockTransform . Received ( 1 ) . Invoke (
83
+ Arg . Is < CommandApdu > ( a => a == commandApdu ) ,
84
+ Arg . Any < Type > ( ) ,
85
+ Arg . Any < Type > ( ) ) ;
85
86
}
86
87
87
88
[ Fact ]
@@ -115,9 +116,10 @@ public void Invoke_CommandApduWithSmallData_InvokesNextTransformWithSameApdu()
115
116
_ = transform . Invoke ( commandApdu , typeof ( object ) , typeof ( object ) ) ;
116
117
117
118
// Assert
118
- mockTransform . Verify (
119
- x =>
120
- x . Invoke ( Arg . Is < CommandApdu > ( a => a == commandApdu ) , Arg . Any < Type > ( ) , Arg . Any < Type > ( ) ) ) ;
119
+ mockTransform . Received ( 1 ) . Invoke (
120
+ Arg . Is < CommandApdu > ( a => a == commandApdu ) ,
121
+ Arg . Any < Type > ( ) ,
122
+ Arg . Any < Type > ( ) ) ;
121
123
}
122
124
123
125
[ Fact ]
@@ -151,8 +153,11 @@ public void Invoke_CommandApduWithLargeDataBuffer_OrsHex10ToClaOnAllExceptLast()
151
153
152
154
_ = mockTransform . Invoke ( Arg . Any < CommandApdu > ( ) , Arg . Any < Type > ( ) , Arg . Any < Type > ( ) )
153
155
. Returns ( new ResponseApdu ( new byte [ ] { 0x90 , 0x00 } ) )
154
- . Callback < CommandApdu , Type , Type > ( ( a , b , c ) => observedCla . Add ( a . Cla ) ) ;
155
-
156
+ . AndDoes ( callInfo =>
157
+ {
158
+ var apdu = callInfo . ArgAt < CommandApdu > ( 0 ) ;
159
+ observedCla . Add ( apdu . Cla ) ;
160
+ } ) ;
156
161
// Act
157
162
_ = transform . Invoke ( commandApdu , typeof ( object ) , typeof ( object ) ) ;
158
163
@@ -178,7 +183,11 @@ public void Invoke_CommandApduWithLargeDataBuffer_AllOtherApduPropertiesRemainUn
178
183
179
184
_ = mockTransform . Invoke ( Arg . Any < CommandApdu > ( ) , Arg . Any < Type > ( ) , Arg . Any < Type > ( ) )
180
185
. Returns ( new ResponseApdu ( new byte [ ] { 0x90 , 0x00 } ) )
181
- . Callback < CommandApdu , Type , Type > ( ( a , b , c ) => observedApdus . Add ( a ) ) ;
186
+ . AndDoes ( callInfo =>
187
+ {
188
+ var apdu = callInfo . ArgAt < CommandApdu > ( 0 ) ;
189
+ observedApdus . Add ( apdu ) ;
190
+ } ) ;
182
191
183
192
// Act
184
193
_ = transform . Invoke ( commandApdu , typeof ( object ) , typeof ( object ) ) ;
@@ -207,8 +216,11 @@ public void Invoke_CommandApduWithLargeDataBuffer_SplitsDataAcrossInvokeCalls()
207
216
208
217
_ = mockTransform . Invoke ( Arg . Any < CommandApdu > ( ) , Arg . Any < Type > ( ) , Arg . Any < Type > ( ) )
209
218
. Returns ( new ResponseApdu ( new byte [ ] { 0x90 , 0x00 } ) )
210
- . Callback < CommandApdu , Type , Type > ( ( a , b , c ) => observedApdus . Add ( a . Data . ToArray ( ) ) ) ;
211
-
219
+ . AndDoes ( callInfo =>
220
+ {
221
+ var apdu = callInfo . ArgAt < CommandApdu > ( 0 ) ;
222
+ observedApdus . Add ( apdu . Data . ToArray ( ) ) ;
223
+ } ) ;
212
224
// Act
213
225
_ = transform . Invoke ( commandApdu , typeof ( object ) , typeof ( object ) ) ;
214
226
@@ -217,7 +229,7 @@ public void Invoke_CommandApduWithLargeDataBuffer_SplitsDataAcrossInvokeCalls()
217
229
Assert . Equal ( new byte [ ] { 5 , 6 , 7 , 8 } , observedApdus [ 1 ] ) ;
218
230
Assert . Equal ( new byte [ ] { 9 , 10 } , observedApdus [ 2 ] ) ;
219
231
}
220
-
232
+
221
233
[ Fact ]
222
234
public void Invoke_CommandApduWithLargeDataBuffer_DoesntProcessAllBytes ( )
223
235
{
@@ -233,9 +245,10 @@ public void Invoke_CommandApduWithLargeDataBuffer_DoesntProcessAllBytes()
233
245
234
246
_ = mockTransform . Invoke ( Arg . Any < CommandApdu > ( ) , Arg . Any < Type > ( ) , Arg . Any < Type > ( ) )
235
247
. Returns ( new ResponseApdu ( [ ] , 0x6700 ) )
236
- . Callback < CommandApdu , Type , Type > ( ( a , b , c ) =>
248
+ . AndDoes ( callInfo =>
237
249
{
238
- observedApdus . Add ( a . Data . ToArray ( ) ) ;
250
+ var apdu = callInfo . ArgAt < CommandApdu > ( 0 ) ;
251
+ observedApdus . Add ( apdu . Data . ToArray ( ) ) ;
239
252
} ) ;
240
253
241
254
// Act
0 commit comments