File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/VirtualClient/VirtualClient.TestFramework Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 3
3
4
4
namespace VirtualClient
5
5
{
6
+ using System ;
6
7
using System . Collections . Generic ;
7
8
using Renci . SshNet ;
8
9
@@ -24,10 +25,15 @@ public InMemorySshClientFactory()
24
25
/// </summary>
25
26
public IEnumerable < ISshClientProxy > SshClients { get ; }
26
27
28
+ /// <summary>
29
+ /// Delegate defines logic to execute when the 'CreateClient' method is called.
30
+ /// </summary>
31
+ public Func < ConnectionInfo , ISshClientProxy > OnCreateClient { get ; set ; }
32
+
27
33
/// <inheritdoc />
28
34
public ISshClientProxy CreateClient ( ConnectionInfo connection )
29
35
{
30
- ISshClientProxy sshClient = new InMemorySshClient ( connection ) ;
36
+ ISshClientProxy sshClient = this . OnCreateClient ? . Invoke ( connection ) ?? new InMemorySshClient ( connection ) ;
31
37
( this . SshClients as List < ISshClientProxy > ) . Add ( sshClient ) ;
32
38
33
39
return sshClient ;
You can’t perform that action at this time.
0 commit comments