@@ -183,12 +183,15 @@ public void CanUseBranchNameOffAReleaseBranch()
183
183
fixture . AssertFullSemver ( "0.3.0-PROJ-1.1+3" , configuration ) ;
184
184
}
185
185
186
- [ TestCase ( "alpha" , "JIRA-123" , "alpha" ) ]
187
- [ TestCase ( $ "alpha.{ ConfigurationConstants . BranchNamePlaceholder } ", "JIRA-123" , "alpha.JIRA-123" ) ]
188
- public void ShouldUseConfiguredTag ( string tag , string featureName , string preReleaseTagName )
186
+ [ TestCase ( "alpha" , "JIRA-123" , "^features?[/-](?<BranchName>.+)" , "alpha" ) ]
187
+ [ TestCase ( $ "alpha.{ ConfigurationConstants . BranchNamePlaceholder } ", "JIRA-123" , "^features?[/-](?<BranchName>.+)" , "alpha.JIRA-123" ) ]
188
+ [ TestCase ( "{BranchName}-of-task-number-{TaskNumber}" , "4711_this-is-a-feature" , "^features?[/-](?<TaskNumber>\\ d+)_(?<BranchName>.+)" , "this-is-a-feature-of-task-number-4711" ) ]
189
+ public void ShouldUseConfiguredLabel ( string label , string featureName , string regularExpression , string preReleaseLabelName )
189
190
{
190
191
var configuration = GitFlowConfigurationBuilder . New
191
- . WithBranch ( "feature" , builder => builder . WithLabel ( tag ) )
192
+ . WithBranch ( "feature" , builder => builder
193
+ . WithLabel ( label )
194
+ . WithRegularExpression ( regularExpression ) )
192
195
. Build ( ) ;
193
196
194
197
using var fixture = new EmptyRepositoryFixture ( ) ;
@@ -197,7 +200,7 @@ public void ShouldUseConfiguredTag(string tag, string featureName, string preRel
197
200
fixture . BranchTo ( featureBranchName ) ;
198
201
fixture . Repository . MakeCommits ( 5 ) ;
199
202
200
- var expectedFullSemVer = $ "1.0.1-{ preReleaseTagName } .1+5";
203
+ var expectedFullSemVer = $ "1.0.1-{ preReleaseLabelName } .1+5";
201
204
fixture . AssertFullSemver ( expectedFullSemVer , configuration ) ;
202
205
}
203
206
0 commit comments