@@ -16,6 +16,7 @@ public class DependencyManagementTests
16
16
private readonly string _dependencyManagementDirectory ;
17
17
private readonly string _functionId ;
18
18
private const string ManagedDependenciesFolderName = "ManagedDependencies" ;
19
+ private const string AzureFunctionsFolderName = "AzureFunctions" ;
19
20
20
21
public DependencyManagementTests ( )
21
22
{
@@ -42,6 +43,14 @@ private FunctionLoadRequest GetFuncLoadRequest(string functionAppRoot, bool mana
42
43
return functionLoadRequest ;
43
44
}
44
45
46
+ private string GetManagedDependenciesPath ( string functionAppRootPath )
47
+ {
48
+ string functionAppName = Path . GetFileName ( functionAppRootPath ) ;
49
+ string appDataFolder = Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData , Environment . SpecialFolderOption . DoNotVerify ) ;
50
+ string managedDependenciesFolderPath = Path . Combine ( appDataFolder , AzureFunctionsFolderName , functionAppName , ManagedDependenciesFolderName ) ;
51
+ return managedDependenciesFolderPath ;
52
+ }
53
+
45
54
private void TestCaseCleanup ( )
46
55
{
47
56
// We run a test case clean up to reset DependencyManager.Dependencies and DependencyManager.DependenciesPath
@@ -66,10 +75,10 @@ public void TestManagedDependencyBasicRequirements()
66
75
{
67
76
// Test case setup.
68
77
var requirementsDirectoryName = "BasicRequirements" ;
69
- var functionFolderPath = Path . Combine ( _dependencyManagementDirectory , requirementsDirectoryName ,
70
- "FunctionDirectory" ) ;
71
- var managedDependenciesFolderPath = Path . Combine ( _dependencyManagementDirectory ,
72
- requirementsDirectoryName , ManagedDependenciesFolderName ) ;
78
+ var functionFolderPath = Path . Combine ( _dependencyManagementDirectory , requirementsDirectoryName , "FunctionDirectory" ) ;
79
+ var functionAppRoot = Path . Combine ( _dependencyManagementDirectory , requirementsDirectoryName ) ;
80
+ var managedDependenciesFolderPath = GetManagedDependenciesPath ( functionAppRoot ) ;
81
+
73
82
var functionLoadRequest = GetFuncLoadRequest ( functionFolderPath , true ) ;
74
83
75
84
// Create DependencyManager and process the requirements.psd1 file at the function app root.
@@ -97,10 +106,9 @@ public void TestManagedDependencyEmptyHashtableRequirement()
97
106
{
98
107
// Test case setup.
99
108
var requirementsDirectoryName = "EmptyHashtableRequirement" ;
100
- var functionFolderPath = Path . Combine ( _dependencyManagementDirectory , requirementsDirectoryName ,
101
- "FunctionDirectory" ) ;
102
- var managedDependenciesFolderPath = Path . Combine ( _dependencyManagementDirectory ,
103
- requirementsDirectoryName , ManagedDependenciesFolderName ) ;
109
+ var functionFolderPath = Path . Combine ( _dependencyManagementDirectory , requirementsDirectoryName , "FunctionDirectory" ) ;
110
+ var functionAppRoot = Path . Combine ( _dependencyManagementDirectory , requirementsDirectoryName ) ;
111
+ var managedDependenciesFolderPath = GetManagedDependenciesPath ( functionAppRoot ) ;
104
112
var functionLoadRequest = GetFuncLoadRequest ( functionFolderPath , true ) ;
105
113
106
114
// Create DependencyManager and process the requirements.psd1 file at the function app root.
0 commit comments