@@ -10,32 +10,32 @@ public PasswordAuthenticationMethod CreatePowerUserPasswordAuthenticationMethod(
1010
1111 public PrivateKeyAuthenticationMethod CreateRegularUserPrivateKeyAuthenticationMethod ( )
1212 {
13- var privateKeyFile = GetPrivateKey ( "Renci.SshNet.IntegrationTests. resources.client.id_rsa" ) ;
13+ var privateKeyFile = GetPrivateKey ( "resources.client.id_rsa" ) ;
1414 return new PrivateKeyAuthenticationMethod ( Users . Regular . UserName , privateKeyFile ) ;
1515 }
1616
1717 public PrivateKeyAuthenticationMethod CreateRegularUserMultiplePrivateKeyAuthenticationMethod ( )
1818 {
19- var privateKeyFile1 = GetPrivateKey ( "Renci.SshNet.IntegrationTests. resources.client.id_rsa" ) ;
20- var privateKeyFile2 = GetPrivateKey ( "Renci.SshNet.IntegrationTests. resources.client.id_rsa" ) ;
19+ var privateKeyFile1 = GetPrivateKey ( "resources.client.id_rsa" ) ;
20+ var privateKeyFile2 = GetPrivateKey ( "resources.client.id_rsa" ) ;
2121 return new PrivateKeyAuthenticationMethod ( Users . Regular . UserName , privateKeyFile1 , privateKeyFile2 ) ;
2222 }
2323
2424 public PrivateKeyAuthenticationMethod CreateRegularUserPrivateKeyWithPassPhraseAuthenticationMethod ( )
2525 {
26- var privateKeyFile = GetPrivateKey ( "Renci.SshNet.IntegrationTests. resources.client.id_rsa_with_pass" , "tester" ) ;
26+ var privateKeyFile = GetPrivateKey ( "resources.client.id_rsa_with_pass" , "tester" ) ;
2727 return new PrivateKeyAuthenticationMethod ( Users . Regular . UserName , privateKeyFile ) ;
2828 }
2929
3030 public PrivateKeyAuthenticationMethod CreateRegularUserPrivateKeyWithEmptyPassPhraseAuthenticationMethod ( )
3131 {
32- var privateKeyFile = GetPrivateKey ( "Renci.SshNet.IntegrationTests. resources.client.id_rsa_with_pass" , null ) ;
32+ var privateKeyFile = GetPrivateKey ( "resources.client.id_rsa_with_pass" , null ) ;
3333 return new PrivateKeyAuthenticationMethod ( Users . Regular . UserName , privateKeyFile ) ;
3434 }
3535
3636 public PrivateKeyAuthenticationMethod CreateRegularUserPrivateKeyAuthenticationMethodWithBadKey ( )
3737 {
38- var privateKeyFile = GetPrivateKey ( "Renci.SshNet.IntegrationTests. resources.client.id_noaccess.rsa" ) ;
38+ var privateKeyFile = GetPrivateKey ( "resources.client.id_noaccess.rsa" ) ;
3939 return new PrivateKeyAuthenticationMethod ( Users . Regular . UserName , privateKeyFile ) ;
4040 }
4141
@@ -64,21 +64,10 @@ public KeyboardInteractiveAuthenticationMethod CreateRegularUserKeyboardInteract
6464
6565 private PrivateKeyFile GetPrivateKey ( string resourceName , string passPhrase = null )
6666 {
67- using ( var stream = GetResourceStream ( resourceName ) )
67+ using ( var stream = TestBase . GetData ( resourceName ) )
6868 {
6969 return new PrivateKeyFile ( stream , passPhrase ) ;
7070 }
7171 }
72-
73- private Stream GetResourceStream ( string resourceName )
74- {
75- var type = GetType ( ) ;
76- var resourceStream = type . Assembly . GetManifestResourceStream ( resourceName ) ;
77- if ( resourceStream == null )
78- {
79- throw new ArgumentException ( $ "Resource '{ resourceName } ' not found in assembly '{ type . Assembly . FullName } '.", nameof ( resourceName ) ) ;
80- }
81- return resourceStream ;
82- }
8372 }
8473}
0 commit comments