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