File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
github-monitor/Ahk.GitHub.Monitor.Tests/IntegrationTests/Helpers Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
12using Ahk . GitHub . Monitor . Config ;
23using Ahk . GitHub . Monitor . Services . EventDispatch ;
4+ using Microsoft . Extensions . Configuration ;
35using Microsoft . Extensions . Logging ;
46using Microsoft . Extensions . Options ;
57using Moq ;
@@ -13,6 +15,21 @@ internal static class FunctionBuilder
1315 GitHubAppId = "appid" , GitHubAppPrivateKey = "appprivatekey" , GitHubWebhookSecret = "webhooksecret"
1416 } ;
1517
18+
1619 public static GitHubMonitorFunction Create ( IEventDispatchService dispatchService = null )
17- => new ( dispatchService ?? new Mock < IEventDispatchService > ( ) . Object , Options . Create ( AppConfig ) , new Mock < ILogger < GitHubMonitorFunction > > ( ) . Object ) ;
20+ {
21+ var configValues = new Dictionary < string , string >
22+ {
23+ { "GitHubMonitorConfig:test:GitHubAppId" , AppConfig . GitHubAppId } ,
24+ { "GitHubMonitorConfig:test:GitHubAppPrivateKey" , AppConfig . GitHubAppPrivateKey } ,
25+ { "GitHubMonitorConfig:test:GitHubWebhookSecret" , AppConfig . GitHubWebhookSecret }
26+ } ;
27+
28+ var configuration = new ConfigurationBuilder ( )
29+ . AddInMemoryCollection ( configValues )
30+ . Build ( ) ;
31+
32+ return new GitHubMonitorFunction (
33+ dispatchService ?? new Mock < IEventDispatchService > ( ) . Object , new Mock < ILogger < GitHubMonitorFunction > > ( ) . Object , configuration ) ;
34+ }
1835}
You can’t perform that action at this time.
0 commit comments