@@ -50,19 +50,19 @@ public void It_respects_opt_outs(string attributeToOptOut)
5050 . Should ( )
5151 . Pass ( ) ;
5252
53- var expectedInfo = new HashSet < ( string Key , string Value ) >
54- {
55- ( "AssemblyInformationalVersionAttribute" , "1.2.3-beta" ) ,
56- ( "AssemblyFileVersionAttribute" , "4.5.6.7" ) ,
57- ( "AssemblyVersionAttribute" , "8.9.10.11" ) ,
58- ( "AssemblyCompanyAttribute" , "TestCompany" ) ,
59- ( "AssemblyConfigurationAttribute" , "Release" ) ,
60- ( "AssemblyCopyrightAttribute" , "TestCopyright" ) ,
61- ( "AssemblyDescriptionAttribute" , "TestDescription" ) ,
62- ( "AssemblyProductAttribute" , "TestProduct" ) ,
63- ( "AssemblyTitleAttribute" , "TestTitle" ) ,
64- ( "AssemblyTrademarkAttribute" , "TestTrademark" ) ,
65- ( "NeutralResourcesLanguageAttribute" , "fr" ) ,
53+ var expectedInfo = new SortedDictionary < string , string >
54+ {
55+ { "AssemblyInformationalVersionAttribute" , "1.2.3-beta" } ,
56+ { "AssemblyFileVersionAttribute" , "4.5.6.7" } ,
57+ { "AssemblyVersionAttribute" , "8.9.10.11" } ,
58+ { "AssemblyCompanyAttribute" , "TestCompany" } ,
59+ { "AssemblyConfigurationAttribute" , "Release" } ,
60+ { "AssemblyCopyrightAttribute" , "TestCopyright" } ,
61+ { "AssemblyDescriptionAttribute" , "TestDescription" } ,
62+ { "AssemblyProductAttribute" , "TestProduct" } ,
63+ { "AssemblyTitleAttribute" , "TestTitle" } ,
64+ { "AssemblyTrademarkAttribute" , "TestTrademark" } ,
65+ { "NeutralResourcesLanguageAttribute" , "fr" } ,
6666 } ;
6767
6868 if ( attributeToOptOut == "All" )
@@ -71,15 +71,15 @@ public void It_respects_opt_outs(string attributeToOptOut)
7171 }
7272 else
7373 {
74- expectedInfo . RemoveWhere ( i => i . Key == attributeToOptOut ) ;
74+ expectedInfo . Remove ( attributeToOptOut ) ;
7575 }
7676
77- expectedInfo . Add ( ( "TargetFrameworkAttribute" , $ ".NETCoreApp,Version=v{ ToolsetInfo . CurrentTargetFrameworkVersion } ") ) ;
77+ expectedInfo . Add ( "TargetFrameworkAttribute" , $ ".NETCoreApp,Version=v{ ToolsetInfo . CurrentTargetFrameworkVersion } ") ;
7878
7979 var assemblyPath = Path . Combine ( buildCommand . GetOutputDirectory ( ToolsetInfo . CurrentTargetFramework , "Release" ) . FullName , "HelloWorld.dll" ) ;
8080 var actualInfo = AssemblyInfo . Get ( assemblyPath ) ;
8181
82- actualInfo . Should ( ) . BeEquivalentTo ( expectedInfo ) ;
82+ actualInfo . Should ( ) . Equal ( expectedInfo ) ;
8383 }
8484
8585 [ Fact ]
@@ -235,7 +235,7 @@ public void It_includes_source_revision_id_if_available__version_with_plus()
235235 command . GetValues ( ) . Should ( ) . BeEquivalentTo ( new [ ] { "1.2.3+abc.xyz" } ) ;
236236 }
237237
238- [ Theory ]
238+ [ WindowsOnlyTheory ]
239239 [ InlineData ( ToolsetInfo . CurrentTargetFramework ) ]
240240 [ InlineData ( "net45" ) ]
241241 public void It_respects_version_prefix ( string targetFramework )
@@ -258,9 +258,9 @@ public void It_respects_version_prefix(string targetFramework)
258258 var assemblyPath = Path . Combine ( buildCommand . GetOutputDirectory ( targetFramework ) . FullName , "HelloWorld.dll" ) ;
259259 var info = AssemblyInfo . Get ( assemblyPath ) ;
260260
261- info . Should ( ) . Contain ( ( "AssemblyVersionAttribute" , " 1.2.3.0") ) ;
262- info . Should ( ) . Contain ( ( "AssemblyFileVersionAttribute" , " 1.2.3.0") ) ;
263- info . Should ( ) . Contain ( ( "AssemblyInformationalVersionAttribute" , " 1.2.3") ) ;
261+ info [ "AssemblyVersionAttribute" ] . Should ( ) . Be ( " 1.2.3.0") ;
262+ info [ "AssemblyFileVersionAttribute" ] . Should ( ) . Be ( " 1.2.3.0") ;
263+ info [ "AssemblyInformationalVersionAttribute" ] . Should ( ) . Be ( " 1.2.3") ;
264264 }
265265
266266 [ WindowsOnlyTheory ]
@@ -285,7 +285,7 @@ public void It_respects_version_changes_on_incremental_build(string targetFramew
285285 // Then the version of the built assembly shall match the provided VersionPrefix
286286 var assemblyPath = Path . Combine ( incrementalBuildCommand . GetOutputDirectory ( targetFramework ) . FullName , "HelloWorld.dll" ) ;
287287 var info = AssemblyInfo . Get ( assemblyPath ) ;
288- info . Should ( ) . Contain ( ( "AssemblyVersionAttribute" , " 1.2.4.0") ) ;
288+ info [ "AssemblyVersionAttribute" ] . Should ( ) . Be ( " 1.2.4.0") ;
289289
290290 BuildCommand BuildProject ( string versionPrefix )
291291 {
@@ -307,7 +307,7 @@ public void It_respects_custom_assembly_attribute_items_on_incremental_build()
307307
308308 var firstBuildCommand = BuildProject ( buildNumber : "1" ) ;
309309 var assemblyPath = Path . Combine ( firstBuildCommand . GetOutputDirectory ( targetFramework ) . FullName , "TestLibrary.dll" ) ;
310- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . Contain ( ( "AssemblyMetadataAttribute" , " BuildNumber:1") ) ;
310+ AssemblyInfo . Get ( assemblyPath ) [ "AssemblyMetadataAttribute" ] . Should ( ) . Be ( " BuildNumber:1") ;
311311
312312 var firstWriteTime = File . GetLastWriteTimeUtc ( assemblyPath ) ;
313313
@@ -324,7 +324,7 @@ public void It_respects_custom_assembly_attribute_items_on_incremental_build()
324324 File . GetLastWriteTimeUtc ( assemblyPath ) . Should ( ) . NotBe ( firstWriteTime ) ;
325325
326326 // and the custom assembly should be generated with the updated value.
327- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . Contain ( ( "AssemblyMetadataAttribute" , " BuildNumber:2") ) ;
327+ AssemblyInfo . Get ( assemblyPath ) [ "AssemblyMetadataAttribute" ] . Should ( ) . Be ( " BuildNumber:2") ;
328328
329329 BuildCommand BuildProject ( string buildNumber )
330330 {
@@ -358,7 +358,7 @@ public void It_includes_internals_visible_to()
358358
359359 var assemblyPath = Path . Combine ( buildCommand . GetOutputDirectory ( "netstandard2.0" ) . FullName , "HelloWorld.dll" ) ;
360360
361- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . Contain ( ( "InternalsVisibleToAttribute" , " Tests") ) ;
361+ AssemblyInfo . Get ( assemblyPath ) [ "InternalsVisibleToAttribute" ] . Should ( ) . Be ( " Tests") ;
362362 }
363363
364364 [ RequiresMSBuildVersionTheory ( "17.0.0.32901" ) ]
@@ -552,7 +552,7 @@ public void It_respects_out_out_of_internals_visible_to()
552552
553553 var assemblyPath = Path . Combine ( buildCommand . GetOutputDirectory ( "netstandard2.0" ) . FullName , "HelloWorld.dll" ) ;
554554
555- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . NotContain ( i => i . Key == "InternalsVisibleToAttribute" ) ;
555+ Assert . False ( AssemblyInfo . Get ( assemblyPath ) . ContainsKey ( "InternalsVisibleToAttribute" ) ) ;
556556 }
557557
558558 [ Fact ]
@@ -578,7 +578,7 @@ public void It_includes_internals_visible_to_with_key()
578578
579579 var assemblyPath = Path . Combine ( buildCommand . GetOutputDirectory ( "netstandard2.0" ) . FullName , "HelloWorld.dll" ) ;
580580
581- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . Contain ( ( "InternalsVisibleToAttribute" , " Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001001d3e6bbb36e11ea61ceff6e1022b23dd779fc6230838db2d25a2c7c8433b3fcf86b16c25b281fc3db1027c0675395e7d0548e6add88b6a811962bf958101fa9e243b1618313bee11f5e3b3fefda7b1d1226311b6cc2d07e87ff893ba6890b20082df34a0aac14b605b8be055e81081a626f8c69e9ed4bbaa4eae9f94a35accd2") ) ;
581+ AssemblyInfo . Get ( assemblyPath ) [ "InternalsVisibleToAttribute" ] . Should ( ) . Be ( " Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001001d3e6bbb36e11ea61ceff6e1022b23dd779fc6230838db2d25a2c7c8433b3fcf86b16c25b281fc3db1027c0675395e7d0548e6add88b6a811962bf958101fa9e243b1618313bee11f5e3b3fefda7b1d1226311b6cc2d07e87ff893ba6890b20082df34a0aac14b605b8be055e81081a626f8c69e9ed4bbaa4eae9f94a35accd2") ;
582582 }
583583
584584 [ Fact ]
@@ -605,7 +605,7 @@ public void It_includes_internals_visible_to_with_project_publickey()
605605
606606 var assemblyPath = Path . Combine ( buildCommand . GetOutputDirectory ( "netstandard2.0" ) . FullName , "HelloWorld.dll" ) ;
607607
608- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . Contain ( ( "InternalsVisibleToAttribute" , " Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001001d3e6bbb36e11ea61ceff6e1022b23dd779fc6230838db2d25a2c7c8433b3fcf86b16c25b281fc3db1027c0675395e7d0548e6add88b6a811962bf958101fa9e243b1618313bee11f5e3b3fefda7b1d1226311b6cc2d07e87ff893ba6890b20082df34a0aac14b605b8be055e81081a626f8c69e9ed4bbaa4eae9f94a35accd2") ) ;
608+ AssemblyInfo . Get ( assemblyPath ) [ "InternalsVisibleToAttribute" ] . Should ( ) . Be ( " Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001001d3e6bbb36e11ea61ceff6e1022b23dd779fc6230838db2d25a2c7c8433b3fcf86b16c25b281fc3db1027c0675395e7d0548e6add88b6a811962bf958101fa9e243b1618313bee11f5e3b3fefda7b1d1226311b6cc2d07e87ff893ba6890b20082df34a0aac14b605b8be055e81081a626f8c69e9ed4bbaa4eae9f94a35accd2") ;
609609 }
610610
611611 [ Fact ]
@@ -631,11 +631,11 @@ public void It_includes_assembly_metadata()
631631
632632 var assemblyPath = Path . Combine ( buildCommand . GetOutputDirectory ( "netstandard2.0" ) . FullName , "HelloWorld.dll" ) ;
633633
634- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . Contain ( ( "AssemblyMetadataAttribute" , " MetadataKey:MetadataValue") ) ;
634+ AssemblyInfo . Get ( assemblyPath ) [ "AssemblyMetadataAttribute" ] . Should ( ) . Be ( " MetadataKey:MetadataValue") ;
635635 }
636636
637637 [ Fact ]
638- public void It_respects_opt_out_of_assembly_metadata ( )
638+ public void It_respects_out_out_of_assembly_metadata ( )
639639 {
640640 var testAsset = _testAssetsManager
641641 . CopyTestAsset ( "HelloWorld" )
@@ -659,7 +659,7 @@ public void It_respects_opt_out_of_assembly_metadata()
659659
660660 var assemblyPath = Path . Combine ( buildCommand . GetOutputDirectory ( "netstandard2.0" ) . FullName , "HelloWorld.dll" ) ;
661661
662- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . NotContain ( i => i . Key == "AssemblyMetadataAttribute" ) ;
662+ Assert . False ( AssemblyInfo . Get ( assemblyPath ) . ContainsKey ( "AssemblyMetadataAttribute" ) ) ;
663663 }
664664
665665 [ Theory ]
@@ -699,11 +699,11 @@ public void GenerateUserSecrets(bool referenceAspNetCore, bool referenceExtensio
699699
700700 if ( shouldHaveAttribute )
701701 {
702- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . Contain ( ( "UserSecretsIdAttribute" , " SecretsIdValue") ) ;
702+ AssemblyInfo . Get ( assemblyPath ) [ "UserSecretsIdAttribute" ] . Should ( ) . Be ( " SecretsIdValue") ;
703703 }
704704 else
705705 {
706- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . NotContain ( i => i . Key == "SecretsIdValue" ) ;
706+ AssemblyInfo . Get ( assemblyPath ) . Should ( ) . NotContainKey ( "SecretsIdValue" ) ;
707707 }
708708 }
709709
@@ -743,7 +743,7 @@ public void GenerateUserSecretsForTestProject()
743743
744744 var assemblyPath = Path . Combine ( buildCommand . GetOutputDirectory ( testTestProject . TargetFrameworks ) . FullName , testTestProject . Name + ".dll" ) ;
745745
746- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . Contain ( ( "UserSecretsIdAttribute" , " SecretsIdValue") ) ;
746+ AssemblyInfo . Get ( assemblyPath ) [ "UserSecretsIdAttribute" ] . Should ( ) . Be ( " SecretsIdValue") ;
747747 }
748748
749749 [ Theory ]
@@ -775,7 +775,7 @@ public void It_includes_repository_url(bool privateRepo)
775775
776776 var assemblyPath = Path . Combine ( buildCommand . GetOutputDirectory ( testProject . TargetFrameworks ) . FullName , testProject . Name + ".dll" ) ;
777777
778- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . Contain ( ( "AssemblyMetadataAttribute" , " RepositoryUrl:" + fakeUrl ) ) ;
778+ AssemblyInfo . Get ( assemblyPath ) [ "AssemblyMetadataAttribute" ] . Should ( ) . Be ( " RepositoryUrl:" + fakeUrl ) ;
779779 }
780780
781781 [ Theory ]
@@ -804,11 +804,11 @@ public void It_does_not_write_to_undefined_assembly_metadata_attribute(string ta
804804
805805 if ( containsAttribute )
806806 {
807- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . Contain ( ( "AssemblyMetadataAttribute" , " RepositoryUrl:" + fakeUrl ) ) ;
807+ AssemblyInfo . Get ( assemblyPath ) [ "AssemblyMetadataAttribute" ] . Should ( ) . Be ( " RepositoryUrl:" + fakeUrl ) ;
808808 }
809809 else
810810 {
811- AssemblyInfo . Get ( assemblyPath ) . Should ( ) . NotContain ( i => i . Key == "AssemblyMetadataAttribute" ) ;
811+ AssemblyInfo . Get ( assemblyPath ) . ContainsKey ( "AssemblyMetadataAttribute" ) . Should ( ) . Be ( false ) ;
812812 }
813813 }
814814
0 commit comments