@@ -450,5 +450,36 @@ public void CreatingATagAnnotationWithNameOrMessageContainingZeroByteThrows(stri
450
450
"name" , repo . Head . Tip , Constants . Signature , input ) ) ;
451
451
}
452
452
}
453
+
454
+ [ Fact ]
455
+ public void CreatingATagAnnotationWithBadParametersThrows ( )
456
+ {
457
+ using ( var repo = new Repository ( BareTestRepoPath ) )
458
+ {
459
+ Assert . Throws < ArgumentNullException > ( ( ) => repo . ObjectDatabase . CreateTagAnnotation (
460
+ null , repo . Head . Tip , Constants . Signature , "message" ) ) ;
461
+ Assert . Throws < ArgumentException > ( ( ) => repo . ObjectDatabase . CreateTagAnnotation (
462
+ string . Empty , repo . Head . Tip , Constants . Signature , "message" ) ) ;
463
+ Assert . Throws < ArgumentNullException > ( ( ) => repo . ObjectDatabase . CreateTagAnnotation (
464
+ "name" , null , Constants . Signature , "message" ) ) ;
465
+ Assert . Throws < ArgumentNullException > ( ( ) => repo . ObjectDatabase . CreateTagAnnotation (
466
+ "name" , repo . Head . Tip , null , "message" ) ) ;
467
+ Assert . Throws < ArgumentNullException > ( ( ) => repo . ObjectDatabase . CreateTagAnnotation (
468
+ "name" , repo . Head . Tip , Constants . Signature , null ) ) ;
469
+ }
470
+ }
471
+
472
+ [ Fact ]
473
+ public void CanCreateATagAnnotationWithAnEmptyMessage ( )
474
+ {
475
+ string path = CloneBareTestRepo ( ) ;
476
+ using ( var repo = new Repository ( path ) )
477
+ {
478
+ var tagAnnotation = repo . ObjectDatabase . CreateTagAnnotation (
479
+ "name" , repo . Head . Tip , Constants . Signature , string . Empty ) ;
480
+
481
+ Assert . Equal ( string . Empty , tagAnnotation . Message ) ;
482
+ }
483
+ }
453
484
}
454
485
}
0 commit comments