@@ -322,6 +322,39 @@ public void ShouldReplaceAssemblyVersionWithStar(string fileExtension, string as
322
322
} ) ;
323
323
}
324
324
325
+ [ TestCase ( "cs" , "[assembly: AssemblyVersionAttribute(\" 1.0.0.0\" )]\r \n [assembly: AssemblyInformationalVersionAttribute(\" 1.0.0.0\" )]\r \n [assembly: AssemblyFileVersionAttribute(\" 1.0.0.0\" )]" ) ]
326
+ [ TestCase ( "fs" , "[<assembly: AssemblyVersionAttribute(\" 1.0.0.0\" )>]\r \n [<assembly: AssemblyInformationalVersionAttribute(\" 1.0.0.0\" )>]\r \n [<assembly: AssemblyFileVersionAttribute(\" 1.0.0.0\" )>]" ) ]
327
+ [ TestCase ( "vb" , "<Assembly: AssemblyVersionAttribute(\" 1.0.0.0\" )>\r \n <Assembly: AssemblyInformationalVersionAttribute(\" 1.0.0.0\" )>\r \n <Assembly: AssemblyFileVersionAttribute(\" 1.0.0.0\" )>" ) ]
328
+ [ Category ( "NoMono" ) ]
329
+ [ Description ( "Won't run on Mono due to source information not being available for ShouldMatchApproved." ) ]
330
+ public void ShouldReplaceAssemblyVersionWithAtttributeSuffix ( string fileExtension , string assemblyFileContent )
331
+ {
332
+ var workingDir = Path . GetTempPath ( ) ;
333
+ var fileName = Path . Combine ( workingDir , "AssemblyInfo." + fileExtension ) ;
334
+
335
+ VerifyAssemblyInfoFile ( assemblyFileContent , fileName , verify : ( fileSystem , variables ) =>
336
+ {
337
+ var args = new Arguments
338
+ {
339
+ UpdateAssemblyInfo = true ,
340
+ UpdateAssemblyInfoFileName = new HashSet < string >
341
+ {
342
+ "AssemblyInfo." + fileExtension
343
+ }
344
+ } ;
345
+ using ( new AssemblyInfoFileUpdate ( args , workingDir , variables , fileSystem ) )
346
+ {
347
+ fileSystem . Received ( ) . WriteAllText ( fileName , Arg . Is < string > ( s =>
348
+ ! s . Contains ( @"AssemblyVersionAttribute(""1.0.0.0"")" ) &&
349
+ ! s . Contains ( @"AssemblyInformationalVersionAttribute(""1.0.0.0"")" ) &&
350
+ ! s . Contains ( @"AssemblyFileVersionAttribute(""1.0.0.0"")" ) &&
351
+ s . Contains ( @"AssemblyVersion(""2.3.1.0"")" ) &&
352
+ s . Contains ( @"AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")" ) &&
353
+ s . Contains ( @"AssemblyFileVersion(""2.3.1.0"")" ) ) ) ;
354
+ }
355
+ } ) ;
356
+ }
357
+
325
358
[ TestCase ( "cs" ) ]
326
359
[ TestCase ( "fs" ) ]
327
360
[ TestCase ( "vb" ) ]
0 commit comments