File tree Expand file tree Collapse file tree 2 files changed +2
-71
lines changed
LanguageTranslator.v3.IntegrationTests
PersonalityInsights.v3.IntegrationTests Expand file tree Collapse file tree 2 files changed +2
-71
lines changed Original file line number Diff line number Diff line change @@ -41,40 +41,8 @@ public class LTServiceIntTestBasicAuthIamApikey
4141 [ TestInitialize ]
4242 public void Setup ( )
4343 {
44- #region Get Credentials
45- if ( string . IsNullOrEmpty ( credentials ) )
46- {
47- var parentDirectory = Directory . GetParent ( Directory . GetCurrentDirectory ( ) ) . Parent . Parent . Parent . Parent . Parent . Parent . FullName ;
48- string credentialsFilepath = parentDirectory + Path . DirectorySeparatorChar + "sdk-credentials" + Path . DirectorySeparatorChar + "credentials.json" ;
49- if ( File . Exists ( credentialsFilepath ) )
50- {
51- try
52- {
53- credentials = File . ReadAllText ( credentialsFilepath ) ;
54- credentials = Utility . AddTopLevelObjectToJson ( credentials , "VCAP_SERVICES" ) ;
55- }
56- catch ( Exception e )
57- {
58- throw new Exception ( string . Format ( "Failed to load credentials: {0}" , e . Message ) ) ;
59- }
60- }
61- else
62- {
63- Console . WriteLine ( "Credentials file does not exist." ) ;
64- }
65-
66- VcapCredentials vcapCredentials = JsonConvert . DeserializeObject < VcapCredentials > ( credentials ) ;
67- var vcapServices = JObject . Parse ( credentials ) ;
68-
69- Credential credential = vcapCredentials . GetCredentialByname ( "language-translator-sdk" ) [ 0 ] . Credentials ;
70- endpoint = credential . Url ;
71- username = "apikey" ;
72- password = credential . IamApikey ;
73- }
74- #endregion
75-
76- service = new LanguageTranslatorService ( username , password , versionDate ) ;
77- service . SetEndpoint ( endpoint ) ;
44+ service = new LanguageTranslatorService ( ) ;
45+ service . VersionDate = versionDate ;
7846 }
7947
8048 [ TestMethod ]
Original file line number Diff line number Diff line change @@ -38,43 +38,6 @@ public class PersonalityInsightsServiceIntegrationTests
3838 [ TestInitialize ]
3939 public void Setup ( )
4040 {
41- #region Get Credentials
42- if ( string . IsNullOrEmpty ( credentials ) )
43- {
44- var parentDirectory = Directory . GetParent ( Directory . GetCurrentDirectory ( ) ) . Parent . Parent . Parent . Parent . Parent . Parent . FullName ;
45- string credentialsFilepath = parentDirectory + Path . DirectorySeparatorChar + "sdk-credentials" + Path . DirectorySeparatorChar + "credentials.json" ;
46- if ( File . Exists ( credentialsFilepath ) )
47- {
48- try
49- {
50- credentials = File . ReadAllText ( credentialsFilepath ) ;
51- credentials = Utility . AddTopLevelObjectToJson ( credentials , "VCAP_SERVICES" ) ;
52- }
53- catch ( Exception e )
54- {
55- throw new Exception ( string . Format ( "Failed to load credentials: {0}" , e . Message ) ) ;
56- }
57- }
58- else
59- {
60- Console . WriteLine ( "Credentials file does not exist." ) ;
61- }
62-
63- VcapCredentials vcapCredentials = JsonConvert . DeserializeObject < VcapCredentials > ( credentials ) ;
64- var vcapServices = JObject . Parse ( credentials ) ;
65-
66- Credential credential = vcapCredentials . GetCredentialByname ( "personality-insights-sdk" ) [ 0 ] . Credentials ;
67- endpoint = credential . Url ;
68- apikey = credential . IamApikey ;
69- }
70- #endregion
71-
72- TokenOptions tokenOptions = new TokenOptions ( )
73- {
74- IamApiKey = apikey ,
75- ServiceUrl = endpoint
76- } ;
77-
7841 service = new PersonalityInsightsService ( ) ;
7942 service . VersionDate = versionDate ;
8043 }
You can’t perform that action at this time.
0 commit comments