@@ -84,7 +84,7 @@ public void TestFileContent2()
8484 Assert . Contains ( "StyleCop.Analyzers" . ToLowerInvariant ( ) , allPackages ) ;
8585 }
8686
87- private static void ImplicitUsingsTest ( string line , bool expected )
87+ private static void CsProjSettingsTest ( string line , bool expected , Func < FileContent , bool > func )
8888 {
8989 // Setup
9090 var lines = new List < string > ( )
@@ -94,28 +94,52 @@ private static void ImplicitUsingsTest(string line, bool expected)
9494 var fileContent = new TestFileContent ( lines ) ;
9595
9696 // Execute
97- var useImplicitUsings = fileContent . UseImplicitUsings ;
97+ var actual = func ( fileContent ) ;
9898
9999 // Verify
100- Assert . Equal ( expected , useImplicitUsings ) ;
100+ Assert . Equal ( expected , actual ) ;
101101 }
102102
103103 [ Fact ]
104104 public void TestFileContent_ImplicitUsings0 ( )
105105 {
106- ImplicitUsingsTest ( "<ImplicitUsings>false</ImplicitUsings>" , false ) ;
106+ CsProjSettingsTest ( "<ImplicitUsings>false</ImplicitUsings>" , false , fc => fc . UseImplicitUsings ) ;
107107 }
108108
109109 [ Fact ]
110110 public void TestFileContent_ImplicitUsings1 ( )
111111 {
112- ImplicitUsingsTest ( "<ImplicitUsings>true</ImplicitUsings>" , true ) ;
112+ CsProjSettingsTest ( "<ImplicitUsings>true</ImplicitUsings>" , true , fc => fc . UseImplicitUsings ) ;
113113 }
114114
115115 [ Fact ]
116116 public void TestFileContent_ImplicitUsings2 ( )
117117 {
118- ImplicitUsingsTest ( "<ImplicitUsings>enable</ImplicitUsings>" , true ) ;
118+ CsProjSettingsTest ( "<ImplicitUsings>enable</ImplicitUsings>" , true , fc => fc . UseImplicitUsings ) ;
119+ }
120+
121+ [ Fact ]
122+ public void TestFileContent_UseWpf0 ( )
123+ {
124+ CsProjSettingsTest ( "<UseWPF>false</UseWPF>" , false , fc => fc . UseWpf ) ;
125+ }
126+
127+ [ Fact ]
128+ public void TestFileContent_UseWpf1 ( )
129+ {
130+ CsProjSettingsTest ( "<UseWPF>true</UseWPF>" , true , fc => fc . UseWpf ) ;
131+ }
132+
133+ [ Fact ]
134+ public void TestFileContent_UseWindowsForms0 ( )
135+ {
136+ CsProjSettingsTest ( "<UseWindowsForms>false</UseWindowsForms>" , false , fc => fc . UseWindowsForms ) ;
137+ }
138+
139+ [ Fact ]
140+ public void TestFileContent_UseWindowsForms1 ( )
141+ {
142+ CsProjSettingsTest ( "<UseWindowsForms>true</UseWindowsForms>" , true , fc => fc . UseWindowsForms ) ;
119143 }
120144
121145 [ Fact ]
0 commit comments