@@ -248,66 +248,26 @@ public void GivenNotConfigured_WhenResolvingAzureSearchOptions_ThenShouldResolve
248
248
249
249
public class ResolveFunctionTests : ProgramTests
250
250
{
251
- [ Fact ]
252
- public void Can_resolve_OnReleaseSlugChangedFunction ( )
253
- {
254
- // ARRANGE
255
- var sut = GetSut ( ) ;
256
-
257
- // ACT
258
- var actual = ActivatorUtilities . CreateInstance < OnReleaseSlugChangedFunction > ( sut . Services ) ;
259
-
260
- // ASSERT
261
- Assert . NotNull ( actual ) ;
262
- }
263
-
264
- [ Fact ]
265
- public void Can_resolve_OnReleaseVersionPublishedFunction ( )
266
- {
267
- // ARRANGE
268
- var sut = GetSut ( ) ;
269
-
270
- // ACT
271
- var actual = ActivatorUtilities . CreateInstance < OnReleaseVersionPublishedFunction > ( sut . Services ) ;
272
-
273
- // ASSERT
274
- Assert . NotNull ( actual ) ;
275
- }
276
-
277
- [ Fact ]
278
- public void Can_resolve_OnThemeUpdatedFunction ( )
279
- {
280
- // ARRANGE
281
- var sut = GetSut ( ) ;
282
-
283
- // ACT
284
- var actual = ActivatorUtilities . CreateInstance < OnThemeUpdatedFunction > ( sut . Services ) ;
285
-
286
- // ASSERT
287
- Assert . NotNull ( actual ) ;
288
- }
289
-
290
- [ Fact ]
291
- public void Can_resolve_RefreshSearchableDocumentFunction ( )
251
+ public static TheoryData < Type > GetAzureFunctionTypes ( )
292
252
{
293
- // ARRANGE
294
- var sut = GetSut ( ) ;
295
-
296
- // ACT
297
- var actual = ActivatorUtilities . CreateInstance < RefreshSearchableDocumentFunction > ( sut . Services ) ;
298
-
299
- // ASSERT
300
- Assert . NotNull ( actual ) ;
253
+ var types = typeof ( Program )
254
+ . Assembly
255
+ . GetTypes ( )
256
+ . Where ( type => type . Namespace ? . StartsWith ( "GovUk.Education.ExploreEducationStatistics.Content.Search.FunctionApp.Functions." ) == true )
257
+ . Where ( type => type . Name . EndsWith ( "Function" ) ) ;
258
+
259
+ return new TheoryData < Type > ( types ) ;
301
260
}
302
261
303
- [ Fact ]
304
- public void Can_resolve_ReindexSearchableDocumentFunction ( )
262
+ [ Theory ]
263
+ [ MemberData ( nameof ( GetAzureFunctionTypes ) ) ]
264
+ public void Can_resolve_AzureFunction ( Type functionType )
305
265
{
306
266
// ARRANGE
307
267
var sut = GetSut ( ) ;
308
268
309
269
// ACT
310
- var actual = ActivatorUtilities . CreateInstance < ReindexSearchableDocumentsFunction > ( sut . Services ) ;
270
+ var actual = ActivatorUtilities . CreateInstance ( sut . Services , functionType ) ;
311
271
312
272
// ASSERT
313
273
Assert . NotNull ( actual ) ;
0 commit comments