14
14
15
15
namespace Microsoft . Azure . Commands . HPCCache . Test . Fixtures
16
16
{
17
- using System ;
18
- using System . Collections . Generic ;
19
- using System . IO ;
20
- using System . Linq ;
21
- using System . Reflection ;
22
- using Microsoft . Azure . Commands . HPCCache . Test . ScenarioTests ;
17
+ using Microsoft . Azure . Commands . Common . Authentication ;
18
+ using Microsoft . Azure . Commands . Common . Authentication . Models ;
23
19
using Microsoft . Azure . Commands . HPCCache . Test . Utilities ;
24
20
using Microsoft . Azure . Commands . TestFx . Recorder ;
25
21
using Microsoft . Azure . Management . Authorization ;
@@ -33,6 +29,12 @@ namespace Microsoft.Azure.Commands.HPCCache.Test.Fixtures
33
29
using Microsoft . Azure . Test . HttpRecorder ;
34
30
using Microsoft . Rest . Azure ;
35
31
using Microsoft . Rest . ClientRuntime . Azure . TestFramework ;
32
+ using System ;
33
+ using System . Collections . Generic ;
34
+ using System . IO ;
35
+ using System . Linq ;
36
+ using System . Reflection ;
37
+ using Constants = Utilities . Constants ;
36
38
37
39
/// <summary>
38
40
/// Defines the <see cref="HpcCacheTestContext" />.
@@ -64,6 +66,7 @@ public HpcCacheTestContext(
64
66
[ System . Runtime . CompilerServices . CallerMemberName ]
65
67
string methodName = ".ctor" )
66
68
{
69
+ SetupAzureSession ( ) ;
67
70
BuildMockServer ( ) ;
68
71
this . mockContext = MockContext . Start ( suiteObject , methodName ) ;
69
72
this . RegisterSubscriptionForResource ( "Microsoft.StorageCache" ) ;
@@ -79,11 +82,21 @@ public HpcCacheTestContext(
79
82
[ System . Runtime . CompilerServices . CallerMemberName ]
80
83
string methodName = ".ctor" )
81
84
{
85
+ SetupAzureSession ( ) ;
82
86
BuildMockServer ( ) ;
83
87
this . mockContext = MockContext . Start ( type . Name , methodName ) ;
84
88
this . RegisterSubscriptionForResource ( "Microsoft.StorageCache" ) ;
85
89
}
86
90
91
+ private void SetupAzureSession ( )
92
+ {
93
+ AzureSessionInitializer . InitializeAzureSession ( ) ;
94
+ if ( ! ( AzureSession . Instance ? . DataStore is MemoryDataStore ) )
95
+ {
96
+ AzureSession . Instance . DataStore = new MemoryDataStore ( ) ;
97
+ }
98
+ }
99
+
87
100
private void BuildMockServer ( )
88
101
{
89
102
var rpToIgnore = new Dictionary < string , string >
0 commit comments