@@ -84,6 +84,39 @@ public void BindingAttributeContainsExpression__InputBinding_FindsRegexMatch_Ret
84
84
Assert . True ( result ) ;
85
85
}
86
86
87
+ [ Fact ]
88
+ public void BindingAttributeContainsExpression__InputBinding_EmptyConnection_FindsRegexMatch_ReturnsTrue ( )
89
+ {
90
+ var inputBindingJObject = JObject . Parse ( "{\" name\" :\" myBlob\" ,\" direction\" :\" In\" ,\" type\" :\" blob\" ,\" blobPath\" :\" input-container//{id}.txt\" ,\" connection\" :\" \" ,\" properties\" :{\" supportsDeferredBinding\" :true}}" ) ;
91
+ FunctionBinding inputBinding = TestHelpers . CreateBindingFromHost ( _host , inputBindingJObject ) ;
92
+ IEnumerable < FunctionBinding > bindings = new List < FunctionBinding > ( ) { inputBinding } ;
93
+
94
+ bool result = _provider . BindingAttributeContainsExpression ( bindings ) ;
95
+ Assert . True ( result ) ;
96
+ }
97
+
98
+ [ Fact ]
99
+ public void BindingAttributeContainsExpression__InputBinding_EmptyConnection_NoRegex_FindsRegexMatch_ReturnsFalse ( )
100
+ {
101
+ var inputBindingJObject = JObject . Parse ( "{\" name\" :\" myBlob\" ,\" direction\" :\" In\" ,\" type\" :\" blob\" ,\" blobPath\" :\" input-container//file.txt\" ,\" connection\" :\" \" ,\" properties\" :{\" supportsDeferredBinding\" :true}}" ) ;
102
+ FunctionBinding inputBinding = TestHelpers . CreateBindingFromHost ( _host , inputBindingJObject ) ;
103
+ IEnumerable < FunctionBinding > bindings = new List < FunctionBinding > ( ) { inputBinding } ;
104
+
105
+ bool result = _provider . BindingAttributeContainsExpression ( bindings ) ;
106
+ Assert . False ( result ) ;
107
+ }
108
+
109
+ [ Fact ]
110
+ public void BindingAttributeContainsExpression__InputBinding_EmptyFields_FindsRegexMatch_ReturnsFalse ( )
111
+ {
112
+ var inputBindingJObject = JObject . Parse ( "{\" name\" :\" myBlob\" ,\" direction\" :\" In\" ,\" type\" :\" blob\" ,\" blobPath\" :\" \" ,\" connection\" :\" \" ,\" properties\" :{\" supportsDeferredBinding\" :true}}" ) ;
113
+ FunctionBinding inputBinding = TestHelpers . CreateBindingFromHost ( _host , inputBindingJObject ) ;
114
+ IEnumerable < FunctionBinding > bindings = new List < FunctionBinding > ( ) { inputBinding } ;
115
+
116
+ bool result = _provider . BindingAttributeContainsExpression ( bindings ) ;
117
+ Assert . False ( result ) ;
118
+ }
119
+
87
120
[ Fact ]
88
121
public void BindingAttributeContainsExpression_OutputBinding_FindsRegexMatch_ReturnsTrue ( )
89
122
{
@@ -95,6 +128,28 @@ public void BindingAttributeContainsExpression_OutputBinding_FindsRegexMatch_Ret
95
128
Assert . True ( result ) ;
96
129
}
97
130
131
+ [ Fact ]
132
+ public void BindingAttributeContainsExpression_OutputBinding_EmptyConnection_FindsRegexMatch_ReturnsTrue ( )
133
+ {
134
+ var outputBindingJObject = JObject . Parse ( "{\" name\" :\" $return\" ,\" direction\" :\" Out\" ,\" type\" :\" blob\" ,\" blobPath\" :\" output-container//{name}-output.txt\" ,\" connection\" :\" \" ,\" properties\" :{}}" ) ;
135
+ FunctionBinding outputBinding = TestHelpers . CreateBindingFromHost ( _host , outputBindingJObject ) ;
136
+ IEnumerable < FunctionBinding > bindings = new List < FunctionBinding > ( ) { outputBinding } ;
137
+
138
+ bool result = _provider . BindingAttributeContainsExpression ( bindings ) ;
139
+ Assert . True ( result ) ;
140
+ }
141
+
142
+ [ Fact ]
143
+ public void BindingAttributeContainsExpression_OutputBinding_EmptyFields_FindsRegexMatch_ReturnsFalse ( )
144
+ {
145
+ var outputBindingJObject = JObject . Parse ( "{\" name\" :\" $return\" ,\" direction\" :\" Out\" ,\" type\" :\" blob\" ,\" blobPath\" :\" \" ,\" connection\" :\" \" ,\" properties\" :{}}" ) ;
146
+ FunctionBinding outputBinding = TestHelpers . CreateBindingFromHost ( _host , outputBindingJObject ) ;
147
+ IEnumerable < FunctionBinding > bindings = new List < FunctionBinding > ( ) { outputBinding } ;
148
+
149
+ bool result = _provider . BindingAttributeContainsExpression ( bindings ) ;
150
+ Assert . False ( result ) ;
151
+ }
152
+
98
153
[ Fact ]
99
154
public void BindingAttributeContainsExpression_DoesNotFindRegexMatch_ReturnsFalse ( )
100
155
{
0 commit comments