@@ -1452,6 +1452,39 @@ public void ValidateFunction_ThrowsForLegacyBlobTrigger_OnFlexConsumption()
1452
1452
ScriptHost . ValidateFunction ( function . Object , httpFunctions , testEnvironment ) ;
1453
1453
}
1454
1454
1455
+ [ Fact ]
1456
+ public void ValidateFunction_DoesntThrowForHttpTrigger_OnFlexConsumption ( )
1457
+ {
1458
+ var httpFunctions = new Dictionary < string , HttpTriggerAttribute > ( ) ;
1459
+ var name = "test" ;
1460
+
1461
+ BindingMetadata httpTriggerMetadata = BindingMetadata . Create ( JObject . Parse ( "{\" type\" : \" httpTrigger\" ,\" name\" : \" req\" ,\" direction\" : \" in\" }" ) ) ;
1462
+
1463
+ var metadata = new FunctionMetadata ( ) ;
1464
+ metadata . Bindings . Add ( httpTriggerMetadata ) ;
1465
+ var function = new Mock < FunctionDescriptor > ( MockBehavior . Strict , name , null , metadata , null , null , null , null ) ;
1466
+ function . SetupGet ( p => p . HttpTriggerAttribute ) . Returns ( ( ) => null ) ;
1467
+
1468
+ TestEnvironment testEnvironment = new TestEnvironment ( ) ;
1469
+ testEnvironment . SetEnvironmentVariable ( EnvironmentSettingNames . AzureWebsiteSku , ScriptConstants . FlexConsumptionSku ) ;
1470
+
1471
+ var exception = Record . Exception ( ( ) =>
1472
+ {
1473
+ ScriptHost . ValidateFunction ( function . Object , httpFunctions , testEnvironment ) ;
1474
+ } ) ;
1475
+ Assert . Null ( exception ) ;
1476
+
1477
+ metadata . Bindings . Clear ( ) ;
1478
+
1479
+ exception = Record . Exception ( ( ) =>
1480
+ {
1481
+ ScriptHost . ValidateFunction ( function . Object , httpFunctions , testEnvironment ) ;
1482
+ } ) ;
1483
+ Assert . Null ( exception ) ;
1484
+
1485
+ ScriptHost . ValidateFunction ( function . Object , httpFunctions , testEnvironment ) ;
1486
+ }
1487
+
1455
1488
[ Fact ]
1456
1489
public async Task IsFunction_ReturnsExpectedResult ( )
1457
1490
{
0 commit comments