5
5
using System . Collections . Generic ;
6
6
using System ;
7
7
using System . Threading . Tasks ;
8
+ using AzureFunctionsUpdates . Models . Releases ;
9
+ using AzureFunctionsUpdates . Activities . Releases ;
8
10
9
11
namespace AzureFunctionsUpdates . UnitTests . TestObjectBuilders
10
12
{
11
- public static class OrchestrationContextBuilder
13
+ public static class ReleaseUpdateOrchestrationContextBuilder
12
14
{
13
15
public static Mock < DurableOrchestrationContextBase > BuildWithoutHistoryAndWithGitHubRelease ( )
14
16
{
@@ -23,7 +25,7 @@ public static Mock<DurableOrchestrationContextBase> BuildWithoutHistoryAndWithGi
23
25
// Setup GetRepositoryConfigurations
24
26
mockContext
25
27
. Setup ( c => c . CallActivityWithRetryAsync < IReadOnlyList < RepositoryConfiguration > > (
26
- nameof ( GetConfigurations ) ,
28
+ nameof ( GetRepositoryConfigurations ) ,
27
29
It . IsAny < RetryOptions > ( ) ,
28
30
null ) )
29
31
. ReturnsAsync ( repoConfigurations ) ;
@@ -78,14 +80,14 @@ public static Mock<DurableOrchestrationContextBase> BuildWithoutHistoryAndWithGi
78
80
. Setup ( c => c . CallActivityWithRetryAsync (
79
81
nameof ( PostUpdate ) ,
80
82
It . IsAny < RetryOptions > ( ) ,
81
- It . Is < RepositoryRelease > ( r => r . RepositoryName . Equals ( repository1Name ) ) ) )
83
+ It . Is < UpdateMessage > ( message => message . Topic . Contains ( repository1Name ) ) ) )
82
84
. Returns ( Task . CompletedTask ) ;
83
85
84
86
mockContext
85
87
. Setup ( c => c . CallActivityWithRetryAsync (
86
88
nameof ( PostUpdate ) ,
87
89
It . IsAny < RetryOptions > ( ) ,
88
- It . Is < RepositoryRelease > ( r => r . RepositoryName . Equals ( repository2Name ) ) ) )
90
+ It . Is < UpdateMessage > ( message => message . Topic . Contains ( repository2Name ) ) ) )
89
91
. Returns ( Task . CompletedTask ) ;
90
92
91
93
return mockContext ;
@@ -104,7 +106,7 @@ public static Mock<DurableOrchestrationContextBase> BuildWithoutHistoryAndGitHub
104
106
// Setup GetRepositoryConfigurations
105
107
mockContext
106
108
. Setup ( c => c . CallActivityWithRetryAsync < IReadOnlyList < RepositoryConfiguration > > (
107
- nameof ( GetConfigurations ) ,
109
+ nameof ( GetRepositoryConfigurations ) ,
108
110
It . IsAny < RetryOptions > ( ) ,
109
111
null ) )
110
112
. ReturnsAsync ( repoConfigurations ) ;
@@ -154,7 +156,7 @@ public static Mock<DurableOrchestrationContextBase> BuildWithoutHistoryAndGitHub
154
156
. Setup ( c => c . CallActivityWithRetryAsync (
155
157
nameof ( PostUpdate ) ,
156
158
It . IsAny < RetryOptions > ( ) ,
157
- It . Is < RepositoryRelease > ( r => r . RepositoryName . Equals ( repository1Name ) ) ) )
159
+ It . Is < UpdateMessage > ( message => message . Topic . Contains ( repository1Name ) ) ) )
158
160
. Returns ( Task . CompletedTask ) ;
159
161
160
162
return mockContext ;
@@ -175,7 +177,7 @@ public static Mock<DurableOrchestrationContextBase> BuildWithHistoryAndWithGitHu
175
177
// Setup GetRepositoryConfigurations
176
178
mockContext
177
179
. Setup ( c => c . CallActivityWithRetryAsync < IReadOnlyList < RepositoryConfiguration > > (
178
- nameof ( GetConfigurations ) ,
180
+ nameof ( GetRepositoryConfigurations ) ,
179
181
It . IsAny < RetryOptions > ( ) ,
180
182
null ) )
181
183
. ReturnsAsync ( repoConfigurations ) ;
@@ -230,7 +232,7 @@ public static Mock<DurableOrchestrationContextBase> BuildWithHistoryAndWithGitHu
230
232
// Setup GetRepositoryConfigurations
231
233
mockContext
232
234
. Setup ( c => c . CallActivityWithRetryAsync < IReadOnlyList < RepositoryConfiguration > > (
233
- nameof ( GetConfigurations ) ,
235
+ nameof ( GetRepositoryConfigurations ) ,
234
236
It . IsAny < RetryOptions > ( ) ,
235
237
null ) )
236
238
. ReturnsAsync ( repoConfigurations ) ;
@@ -278,7 +280,7 @@ public static Mock<DurableOrchestrationContextBase> BuildWithHistoryAndWithGitHu
278
280
. Setup ( c => c . CallActivityWithRetryAsync (
279
281
nameof ( PostUpdate ) ,
280
282
It . IsAny < RetryOptions > ( ) ,
281
- It . Is < RepositoryRelease > ( r => r . RepositoryName . Equals ( repository2Name ) ) ) )
283
+ It . Is < UpdateMessage > ( message => message . Topic . Contains ( repository2Name ) ) ) )
282
284
. Returns ( Task . CompletedTask ) ;
283
285
284
286
return mockContext ;
0 commit comments