@@ -236,6 +236,36 @@ public void ShouldReplaceAssemblyVersionInRelativePath(string fileExtension, str
236
236
} ) ;
237
237
}
238
238
239
+ [ TestCase ( "cs" , "[assembly: AssemblyVersion ( \" 1.0.0.0\" ) ]\r \n [assembly: AssemblyInformationalVersion\t (\t \" 1.0.0.0\" \t )]\r \n [assembly: AssemblyFileVersion\r \n (\r \n \" 1.0.0.0\" \r \n )]" ) ]
240
+ [ TestCase ( "fs" , "[<assembly: AssemblyVersion ( \" 1.0.0.0\" )>]\r \n [<assembly: AssemblyInformationalVersion\t (\t \" 1.0.0.0\" \t )>]\r \n [<assembly: AssemblyFileVersion\r \n (\r \n \" 1.0.0.0\" \r \n )>]" ) ]
241
+ [ TestCase ( "vb" , "<Assembly: AssemblyVersion ( \" 1.0.0.0\" )>\r \n <Assembly: AssemblyInformationalVersion\t (\t \" 1.0.0.0\" \t )>\r \n <Assembly: AssemblyFileVersion\r \n (\r \n \" 1.0.0.0\" \r \n )>" ) ]
242
+ [ Category ( "NoMono" ) ]
243
+ [ Description ( "Won't run on Mono due to source information not being available for ShouldMatchApproved." ) ]
244
+ public void ShouldReplaceAssemblyVersionInRelativePathWithWhiteSpace ( string fileExtension , string assemblyFileContent )
245
+ {
246
+ var workingDir = Path . GetTempPath ( ) ;
247
+ var fileName = Path . Combine ( workingDir , "Project" , "src" , "Properties" , "AssemblyInfo." + fileExtension ) ;
248
+
249
+ VerifyAssemblyInfoFile ( assemblyFileContent , fileName , AssemblyVersioningScheme . MajorMinor , ( fileSystem , variables ) =>
250
+ {
251
+ var args = new Arguments
252
+ {
253
+ UpdateAssemblyInfo = true ,
254
+ UpdateAssemblyInfoFileName = new HashSet < string >
255
+ {
256
+ Path . Combine ( "Project" , "src" , "Properties" , "AssemblyInfo." + fileExtension )
257
+ }
258
+ } ;
259
+ using ( new AssemblyInfoFileUpdate ( args , workingDir , variables , fileSystem ) )
260
+ {
261
+ fileSystem . Received ( ) . WriteAllText ( fileName , Arg . Is < string > ( s =>
262
+ s . Contains ( @"AssemblyVersion(""2.3.0.0"")" ) &&
263
+ s . Contains ( @"AssemblyInformationalVersion(""2.3.1+3.Branch.foo.Sha.hash"")" ) &&
264
+ s . Contains ( @"AssemblyFileVersion(""2.3.1.0"")" ) ) ) ;
265
+ }
266
+ } ) ;
267
+ }
268
+
239
269
[ TestCase ( "cs" , "[assembly: AssemblyVersion(\" 1.0.0.*\" )]\r \n [assembly: AssemblyInformationalVersion(\" 1.0.0.*\" )]\r \n [assembly: AssemblyFileVersion(\" 1.0.0.*\" )]" ) ]
240
270
[ TestCase ( "fs" , "[<assembly: AssemblyVersion(\" 1.0.0.*\" )>]\r \n [<assembly: AssemblyInformationalVersion(\" 1.0.0.*\" )>]\r \n [<assembly: AssemblyFileVersion(\" 1.0.0.*\" )>]" ) ]
241
271
[ TestCase ( "vb" , "<Assembly: AssemblyVersion(\" 1.0.0.*\" )>\r \n <Assembly: AssemblyInformationalVersion(\" 1.0.0.*\" )>\r \n <Assembly: AssemblyFileVersion(\" 1.0.0.*\" )>" ) ]
0 commit comments