@@ -477,6 +477,43 @@ public void ShouldReplaceAssemblyVersionWhenCreatingVisualBasicAssemblyVersionFi
477
477
}
478
478
}
479
479
480
+ [ Test ]
481
+ public void ShouldAddAssemblyInformationalVersionWhenUpdatingVisualBasicAssemblyVersionFile ( )
482
+ {
483
+ var fileSystem = new TestFileSystem ( ) ;
484
+ var version = new SemanticVersion
485
+ {
486
+ BuildMetaData = new SemanticVersionBuildMetaData ( 3 , "foo" , "hash" , DateTimeOffset . Now ) ,
487
+ Major = 2 ,
488
+ Minor = 3 ,
489
+ Patch = 1
490
+ } ;
491
+
492
+ var workingDir = Path . GetTempPath ( ) ;
493
+ var assemblyInfoFile = Join (
494
+ "<Assembly: AssemblyVersion(\" 1.0.0.0\" )>" ,
495
+ "<Assembly: AssemblyFileVersion(\" 1.0.0.0\" )> " ) ;
496
+
497
+ var fileName = Path . Combine ( workingDir , "AssemblyInfo.vb" ) ;
498
+ fileSystem . WriteAllText ( fileName , assemblyInfoFile ) ;
499
+ var variable = VariableProvider . GetVariablesFor ( version , new TestEffectiveConfiguration ( ) , false ) ;
500
+
501
+ var args = new Arguments
502
+ {
503
+ // EnsureAssemblyInfo = true,
504
+ UpdateAssemblyInfo = true ,
505
+ UpdateAssemblyInfoFileName = new HashSet < string > { "AssemblyInfo.vb" }
506
+ } ;
507
+
508
+ using ( new AssemblyInfoFileUpdate ( args , workingDir , variable , fileSystem ) )
509
+ {
510
+ string expected = Join ( @"<AssemblyVersion(""2.3.1.0"")>" ,
511
+ @"<AssemblyFileVersion(""2.3.1.0"")>" ,
512
+ @"<AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")>" ) ;
513
+ fileSystem . ReadAllText ( fileName ) . ShouldBe ( expected ) ;
514
+ }
515
+ }
516
+
480
517
481
518
private static string Join ( params string [ ] lines )
482
519
{
0 commit comments