@@ -110,7 +110,6 @@ public TestEnvironment(string connectionString)
110
110
111
111
InitTokenDictionary ( ) ;
112
112
SetupHttpRecorderMode ( ) ;
113
- RecorderModeSettings ( ) ;
114
113
}
115
114
116
115
private void InitTestEndPoints ( )
@@ -186,31 +185,6 @@ private void SetupHttpRecorderMode()
186
185
}
187
186
}
188
187
189
- private void RecorderModeSettings ( )
190
- {
191
- if ( HttpMockServer . Mode == HttpRecorderMode . Record )
192
- {
193
- //Restore/Add Subscription Id in MockServer from supplied connection string
194
- if ( HttpMockServer . Variables . ContainsCaseInsensitiveKey ( ConnectionStringKeys . SubscriptionIdKey ) )
195
- {
196
- HttpMockServer . Variables . UpdateDictionary ( ConnectionStringKeys . SubscriptionIdKey , SubscriptionId ) ;
197
- }
198
- else
199
- {
200
- HttpMockServer . Variables . Add ( ConnectionStringKeys . SubscriptionIdKey , SubscriptionId ) ;
201
- }
202
-
203
- // If User has provided Access Token in RawToken/GraphToken Key-Value, we don't need to authenticate
204
- // We currently only check for RawToken and do not check if GraphToken is provided
205
- if ( string . IsNullOrEmpty ( ConnectionString . GetValue ( ConnectionStringKeys . RawTokenKey ) ) )
206
- {
207
- Login ( ) ;
208
- }
209
-
210
- VerifyAuthTokens ( ) ;
211
- }
212
- }
213
-
214
188
private void Login ( )
215
189
{
216
190
string userPassword = ConnectionString . GetValue ( ConnectionStringKeys . PasswordKey ) ;
@@ -413,9 +387,30 @@ private void VerifyGraphToken()
413
387
}
414
388
}
415
389
416
- internal void SetRecordedEnvironmentVariables ( )
390
+ internal void SetEnvironmentVariables ( )
417
391
{
418
- if ( HttpMockServer . Mode == HttpRecorderMode . Playback )
392
+ if ( HttpMockServer . Mode == HttpRecorderMode . Record )
393
+ {
394
+ //Restore/Add Subscription Id in MockServer from supplied connection string
395
+ if ( HttpMockServer . Variables . ContainsCaseInsensitiveKey ( ConnectionStringKeys . SubscriptionIdKey ) )
396
+ {
397
+ HttpMockServer . Variables . UpdateDictionary ( ConnectionStringKeys . SubscriptionIdKey , SubscriptionId ) ;
398
+ }
399
+ else
400
+ {
401
+ HttpMockServer . Variables . Add ( ConnectionStringKeys . SubscriptionIdKey , SubscriptionId ) ;
402
+ }
403
+
404
+ // If User has provided Access Token in RawToken/GraphToken Key-Value, we don't need to authenticate
405
+ // We currently only check for RawToken and do not check if GraphToken is provided
406
+ if ( string . IsNullOrEmpty ( ConnectionString . GetValue ( ConnectionStringKeys . RawTokenKey ) ) )
407
+ {
408
+ Login ( ) ;
409
+ }
410
+
411
+ VerifyAuthTokens ( ) ;
412
+ }
413
+ else if ( HttpMockServer . Mode == HttpRecorderMode . Playback )
419
414
{
420
415
//Get Subscription Id from MockServer. Otherwise, assign zero guid
421
416
if ( HttpMockServer . Variables . ContainsCaseInsensitiveKey ( ConnectionStringKeys . SubscriptionIdKey ) )
0 commit comments