@@ -11,7 +11,7 @@ namespace AdvancedSharpAdbClient.Tests
1111 /// <summary>
1212 /// A mock implementation of the <see cref="IAdbSocket"/> class.
1313 /// </summary>
14- internal class DummyAdbSocket : IDummyAdbSocket
14+ internal class DummyAdbSocket : IDummyAdbSocket , ICloneable < DummyAdbSocket >
1515 {
1616 /// <summary>
1717 /// Use this message to cause <see cref="ReadString"/> and <see cref="ReadStringAsync(CancellationToken)"/> to throw
@@ -21,21 +21,21 @@ internal class DummyAdbSocket : IDummyAdbSocket
2121
2222 public DummyAdbSocket ( ) => IsConnected = true ;
2323
24- public Queue < AdbResponse > Responses { get ; } = new Queue < AdbResponse > ( ) ;
24+ public Queue < AdbResponse > Responses { get ; init ; } = new Queue < AdbResponse > ( ) ;
2525
26- public Queue < SyncCommand > SyncResponses { get ; } = new Queue < SyncCommand > ( ) ;
26+ public Queue < SyncCommand > SyncResponses { get ; init ; } = new Queue < SyncCommand > ( ) ;
2727
28- public Queue < byte [ ] > SyncDataReceived { get ; } = new Queue < byte [ ] > ( ) ;
28+ public Queue < byte [ ] > SyncDataReceived { get ; init ; } = new Queue < byte [ ] > ( ) ;
2929
30- public Queue < byte [ ] > SyncDataSent { get ; } = new Queue < byte [ ] > ( ) ;
30+ public Queue < byte [ ] > SyncDataSent { get ; init ; } = new Queue < byte [ ] > ( ) ;
3131
32- public Queue < string > ResponseMessages { get ; } = new Queue < string > ( ) ;
32+ public Queue < string > ResponseMessages { get ; init ; } = new Queue < string > ( ) ;
3333
34- public List < string > Requests { get ; } = [ ] ;
34+ public List < string > Requests { get ; init ; } = [ ] ;
3535
36- public List < ( SyncCommand , string ) > SyncRequests { get ; } = [ ] ;
36+ public List < ( SyncCommand , string ) > SyncRequests { get ; init ; } = [ ] ;
3737
38- public Queue < Stream > ShellStreams { get ; } = new Queue < Stream > ( ) ;
38+ public Queue < Stream > ShellStreams { get ; init ; } = new Queue < Stream > ( ) ;
3939
4040 public bool IsConnected { get ; set ; }
4141
@@ -295,5 +295,19 @@ public async Task ReconnectAsync(bool isForce, CancellationToken cancellationTok
295295 await Task . Yield ( ) ;
296296 DidReconnect = true ;
297297 }
298+
299+ public DummyAdbSocket Clone ( ) => new ( )
300+ {
301+ Responses = Responses ,
302+ SyncResponses = SyncResponses ,
303+ SyncDataReceived = SyncDataReceived ,
304+ SyncDataSent = SyncDataSent ,
305+ ResponseMessages = ResponseMessages ,
306+ Requests = Requests ,
307+ SyncRequests = SyncRequests ,
308+ ShellStreams = ShellStreams
309+ } ;
310+
311+ object ICloneable . Clone ( ) => Clone ( ) ;
298312 }
299313}
0 commit comments