@@ -18,7 +18,7 @@ public static Mock<DurableOrchestrationContextBase> BuildWithoutHistoryAndWithGi
18
18
// Setup GetRepositoryConfigurations
19
19
mockContext
20
20
. Setup ( c => c . CallActivityWithRetryAsync < IReadOnlyList < RepositoryConfiguration > > (
21
- nameof ( GetRepositoryConfigurations ) ,
21
+ nameof ( GetConfigurations ) ,
22
22
It . IsAny < RetryOptions > ( ) ,
23
23
null ) )
24
24
. ReturnsAsync ( repoConfigurations ) ;
@@ -70,6 +70,70 @@ public static Mock<DurableOrchestrationContextBase> BuildWithoutHistoryAndWithGi
70
70
return mockContext ;
71
71
}
72
72
73
+ public static Mock < DurableOrchestrationContextBase > BuildWithoutHistoryAndGitHubReturnsNullRelease ( )
74
+ {
75
+ const string repository1Name = "repo-1" ;
76
+ const string repository2Name = "repo-2" ;
77
+ var mockContext = new Mock < DurableOrchestrationContextBase > ( ) ;
78
+ var repoConfigurations = RepositoryConfigurationBuilder . BuildTwo ( repository1Name , repository2Name ) ;
79
+
80
+ // Setup GetRepositoryConfigurations
81
+ mockContext
82
+ . Setup ( c => c . CallActivityWithRetryAsync < IReadOnlyList < RepositoryConfiguration > > (
83
+ nameof ( GetConfigurations ) ,
84
+ It . IsAny < RetryOptions > ( ) ,
85
+ null ) )
86
+ . ReturnsAsync ( repoConfigurations ) ;
87
+
88
+ // Setup GetLatestReleaseFromGitHub
89
+ mockContext
90
+ . Setup ( c => c . CallActivityWithRetryAsync < RepositoryRelease > (
91
+ nameof ( GetLatestReleaseFromGitHub ) ,
92
+ It . IsAny < RetryOptions > ( ) ,
93
+ repoConfigurations [ 0 ] ) )
94
+ . ReturnsAsync ( RepositoryReleaseBuilder . BuildOne ( repository1Name ) ) ;
95
+
96
+
97
+ // Returns NullRelease because no release info is retrieved from GitHub
98
+ mockContext
99
+ . Setup ( c => c . CallActivityWithRetryAsync < RepositoryRelease > (
100
+ nameof ( GetLatestReleaseFromGitHub ) ,
101
+ It . IsAny < RetryOptions > ( ) ,
102
+ repoConfigurations [ 1 ] ) )
103
+ . ReturnsAsync ( RepositoryReleaseBuilder . BuildNullRelease ( repository1Name ) ) ;
104
+
105
+ // Setup GetLatestReleaseFromHistory
106
+ mockContext
107
+ . Setup ( c => c . CallActivityWithRetryAsync < RepositoryRelease > (
108
+ nameof ( GetLatestReleaseFromHistory ) ,
109
+ It . IsAny < RetryOptions > ( ) ,
110
+ repoConfigurations [ 0 ] ) )
111
+ . ReturnsAsync ( RepositoryReleaseBuilder . BuildNullRelease ( repository1Name ) ) ;
112
+
113
+ mockContext
114
+ . Setup ( c => c . CallActivityWithRetryAsync < RepositoryRelease > (
115
+ nameof ( GetLatestReleaseFromHistory ) ,
116
+ It . IsAny < RetryOptions > ( ) ,
117
+ repoConfigurations [ 1 ] ) )
118
+ . ReturnsAsync ( RepositoryReleaseBuilder . BuildNullRelease ( repository2Name ) ) ;
119
+
120
+ // Setup SaveLatestRelease
121
+ mockContext
122
+ . Setup ( c => c . CallActivityWithRetryAsync (
123
+ nameof ( SaveLatestRelease ) ,
124
+ It . IsAny < RetryOptions > ( ) ,
125
+ It . IsAny < RepositoryRelease > ( ) ) ) ;
126
+
127
+ // Setup PostUpdate
128
+ mockContext
129
+ . Setup ( c => c . CallActivityWithRetryAsync (
130
+ nameof ( PostUpdate ) ,
131
+ It . IsAny < RetryOptions > ( ) ,
132
+ It . IsAny < RepositoryRelease > ( ) ) ) ;
133
+
134
+ return mockContext ;
135
+ }
136
+
73
137
public static Mock < DurableOrchestrationContextBase > BuildWithHistoryAndWithGitHubWithEqualReleases ( )
74
138
{
75
139
const string repository1Name = "repo-1" ;
@@ -82,7 +146,7 @@ public static Mock<DurableOrchestrationContextBase> BuildWithHistoryAndWithGitHu
82
146
// Setup GetRepositoryConfigurations
83
147
mockContext
84
148
. Setup ( c => c . CallActivityWithRetryAsync < IReadOnlyList < RepositoryConfiguration > > (
85
- nameof ( GetRepositoryConfigurations ) ,
149
+ nameof ( GetConfigurations ) ,
86
150
It . IsAny < RetryOptions > ( ) ,
87
151
null ) )
88
152
. ReturnsAsync ( repoConfigurations ) ;
@@ -148,7 +212,7 @@ public static Mock<DurableOrchestrationContextBase> BuildWithHistoryAndWithGitHu
148
212
// Setup GetRepositoryConfigurations
149
213
mockContext
150
214
. Setup ( c => c . CallActivityWithRetryAsync < IReadOnlyList < RepositoryConfiguration > > (
151
- nameof ( GetRepositoryConfigurations ) ,
215
+ nameof ( GetConfigurations ) ,
152
216
It . IsAny < RetryOptions > ( ) ,
153
217
null ) )
154
218
. ReturnsAsync ( repoConfigurations ) ;
0 commit comments