@@ -321,6 +321,45 @@ await _vcsProvider.Received(1).CreateReleaseAsync(OWNER, REPOSITORY, Arg.Is<Rele
321
321
_logger . Received ( 1 ) . Debug ( Arg . Any < string > ( ) , Arg . Any < Release > ( ) ) ;
322
322
}
323
323
324
+ [ Test ]
325
+ public async Task Should_Create_Release_From_Milestone_With_Assets ( )
326
+ {
327
+ var release = new Release { Assets = new List < ReleaseAsset > ( ) } ;
328
+
329
+ var assetsCount = _assets . Count ;
330
+
331
+ _releaseNotesBuilder . BuildReleaseNotes ( OWNER , REPOSITORY , MILESTONE_TITLE , ReleaseTemplates . DEFAULT_NAME )
332
+ . Returns ( Task . FromResult ( RELEASE_NOTES ) ) ;
333
+
334
+ _vcsProvider . GetReleaseAsync ( OWNER , REPOSITORY , MILESTONE_TITLE )
335
+ . Returns ( Task . FromResult < Release > ( null ) ) ;
336
+
337
+ _vcsProvider . CreateReleaseAsync ( OWNER , REPOSITORY , Arg . Any < Release > ( ) )
338
+ . Returns ( Task . FromResult ( release ) ) ;
339
+
340
+ var result = await _vcsService . CreateReleaseFromMilestoneAsync (
341
+ OWNER ,
342
+ REPOSITORY ,
343
+ MILESTONE_TITLE ,
344
+ MILESTONE_TITLE ,
345
+ null ,
346
+ _assets ,
347
+ false ,
348
+ null
349
+ ) . ConfigureAwait ( false ) ;
350
+ result . ShouldBeSameAs ( release ) ;
351
+
352
+ await _releaseNotesBuilder . Received ( 1 ) . BuildReleaseNotes ( OWNER , REPOSITORY , MILESTONE_TITLE , ReleaseTemplates . DEFAULT_NAME ) . ConfigureAwait ( false ) ;
353
+ await _vcsProvider . Received ( 1 ) . GetReleaseAsync ( OWNER , REPOSITORY , MILESTONE_TITLE ) . ConfigureAwait ( false ) ;
354
+ await _vcsProvider . Received ( 1 ) . CreateReleaseAsync ( OWNER , REPOSITORY , Arg . Is < Release > ( o =>
355
+ o . Body == RELEASE_NOTES &&
356
+ o . Name == MILESTONE_TITLE &&
357
+ o . TagName == MILESTONE_TITLE ) ) . ConfigureAwait ( false ) ;
358
+
359
+ _logger . Received ( 1 ) . Verbose ( Arg . Any < string > ( ) , MILESTONE_TITLE , OWNER , REPOSITORY ) ;
360
+ _logger . Received ( 1 ) . Debug ( Arg . Any < string > ( ) , Arg . Any < Release > ( ) ) ;
361
+ }
362
+
324
363
[ Test ]
325
364
public async Task Should_Create_Release_From_Milestone_Using_Template_File ( )
326
365
{
0 commit comments