@@ -117,6 +117,47 @@ public void GetDefaultHostId_FlexConsumption_ReturnsExpectedResult(string siteNa
117
117
Assert . False ( result . IsTruncated ) ;
118
118
}
119
119
120
+ [ Fact ]
121
+ public void GetDefaultHostId_PlaceholderMode_ReturnsExpectedResult ( )
122
+ {
123
+ var options = new ScriptApplicationHostOptions
124
+ {
125
+ ScriptPath = @"c:\testscripts"
126
+ } ;
127
+
128
+ // In placeholder mode, site name and other settings aren't available to compute the
129
+ // default HostId, so we expect null.
130
+ var environment = new TestEnvironment ( ) ;
131
+ environment . SetEnvironmentVariable ( EnvironmentSettingNames . AzureWebsiteInstanceId , "123123" ) ;
132
+
133
+ Assert . False ( environment . IsFlexConsumptionSku ( ) ) ;
134
+
135
+ var result = ScriptHostIdProvider . GetDefaultHostId ( environment , options ) ;
136
+
137
+ Assert . Equal ( null , result . HostId ) ;
138
+ }
139
+
140
+ [ Fact ]
141
+ public void GetDefaultHostId_PlaceholderMode_FlexConsumption_ReturnsExpectedResult ( )
142
+ {
143
+ var options = new ScriptApplicationHostOptions
144
+ {
145
+ ScriptPath = @"c:\testscripts"
146
+ } ;
147
+
148
+ // In placeholder mode, site name and other settings aren't available to compute the
149
+ // default HostId, so we expect null.
150
+ var environment = new TestEnvironment ( ) ;
151
+ environment . SetEnvironmentVariable ( EnvironmentSettingNames . ContainerName , "testContainer" ) ;
152
+ environment . SetEnvironmentVariable ( EnvironmentSettingNames . LegionServiceHost , "legionhost" ) ;
153
+
154
+ Assert . True ( environment . IsFlexConsumptionSku ( ) ) ;
155
+
156
+ var result = ScriptHostIdProvider . GetDefaultHostId ( environment , options ) ;
157
+
158
+ Assert . Equal ( null , result . HostId ) ;
159
+ }
160
+
120
161
[ Fact ]
121
162
public void GetDefaultHostId_SelfHost_ReturnsExpectedResult ( )
122
163
{
0 commit comments