3
3
using GitVersionCore . Tests ;
4
4
using LibGit2Sharp ;
5
5
using NUnit . Framework ;
6
+ using System . Collections . Generic ;
6
7
7
8
[ TestFixture ]
8
9
public class FeatureBranchScenarios
@@ -223,7 +224,7 @@ public void BranchCreatedAfterFinishReleaseShouldInheritAndIncrementFromLastMast
223
224
fixture . Checkout ( "develop" ) ;
224
225
fixture . Repository . MergeNoFF ( "release/0.2.0" ) ;
225
226
fixture . Repository . Branches . Remove ( "release/2.0.0" ) ;
226
-
227
+
227
228
fixture . Repository . MakeACommit ( ) ;
228
229
229
230
//validate develop branch version after merging release 0.2.0 to master and develop (finish release)
@@ -237,4 +238,49 @@ public void BranchCreatedAfterFinishReleaseShouldInheritAndIncrementFromLastMast
237
238
fixture . AssertFullSemver ( "0.3.0-TEST-1.1+2" ) ;
238
239
}
239
240
}
240
- }
241
+
242
+ [ Test ]
243
+ public void PickUpVersionFromMasterMarkedWithIsDevelop ( )
244
+ {
245
+ var config = new Config
246
+ {
247
+ VersioningMode = VersioningMode . ContinuousDelivery ,
248
+ Branches = new Dictionary < string , BranchConfig >
249
+ {
250
+ {
251
+ "master" , new BranchConfig ( )
252
+ {
253
+ Tag = "pre" ,
254
+ IsDevelop = true ,
255
+ }
256
+ } ,
257
+ {
258
+ "releases?[/-]" , new BranchConfig ( )
259
+ {
260
+ Tag = "rc" ,
261
+ }
262
+ }
263
+ }
264
+ } ;
265
+
266
+ using ( var fixture = new EmptyRepositoryFixture ( ) )
267
+ {
268
+ fixture . MakeACommit ( ) ;
269
+
270
+ // create a release branch and tag a release
271
+ fixture . BranchTo ( "release/0.10.0" ) ;
272
+ fixture . MakeACommit ( ) ;
273
+ fixture . MakeACommit ( ) ;
274
+ fixture . AssertFullSemver ( config , "0.10.0-rc.1+2" ) ;
275
+
276
+ // switch to master and verify the version
277
+ fixture . Checkout ( "master" ) ;
278
+ fixture . MakeACommit ( ) ;
279
+ fixture . AssertFullSemver ( config , "0.10.1-pre.1+1" ) ;
280
+
281
+ // create a feature branch from master and verify the version
282
+ fixture . BranchTo ( "MyFeatureD" ) ;
283
+ fixture . AssertFullSemver ( config , "0.10.1-MyFeatureD.1+1" ) ;
284
+ }
285
+ }
286
+ }
0 commit comments