@@ -175,9 +175,40 @@ public void DoNotHavePublicConstructor()
175
175
. And ( )
176
176
. DoNotHavePublicConstructor ( ) . GetReflectionTypes ( ) ;
177
177
178
- Assert . Equal ( 2 , result . Count ( ) ) ;
178
+ Assert . Equal ( 3 , result . Count ( ) ) ;
179
179
Assert . Contains < Type > ( typeof ( InternalConstructor ) , result ) ;
180
- Assert . Contains < Type > ( typeof ( PrivateConstructor ) , result ) ;
180
+ Assert . Contains < Type > ( typeof ( PrivateConstructor ) , result ) ;
181
+ Assert . Contains < Type > ( typeof ( StaticConstructor ) , result ) ;
182
+ }
183
+
184
+ [ Fact ( DisplayName = "HaveParameterlessConstructor" ) ]
185
+ public void HaveParameterlessConstructor ( )
186
+ {
187
+ var result = fixture . Types
188
+ . That ( )
189
+ . ResideInNamespace ( namespaceof < PublicConstructor > ( ) )
190
+ . And ( )
191
+ . HaveParameterlessConstructor ( ) . GetReflectionTypes ( ) ;
192
+
193
+ Assert . Equal ( 5 , result . Count ( ) ) ;
194
+ Assert . Contains < Type > ( typeof ( DefaultConstructor ) , result ) ;
195
+ Assert . Contains < Type > ( typeof ( InternalConstructor ) , result ) ;
196
+ Assert . Contains < Type > ( typeof ( PrivateConstructor ) , result ) ;
197
+ Assert . Contains < Type > ( typeof ( PublicConstructor ) , result ) ;
198
+ Assert . Contains < Type > ( typeof ( StaticConstructor ) , result ) ;
199
+ }
200
+
201
+ [ Fact ( DisplayName = "DoNotHaveParameterlessConstructor" ) ]
202
+ public void DoNotHaveParameterlessConstructor ( )
203
+ {
204
+ var result = fixture . Types
205
+ . That ( )
206
+ . ResideInNamespace ( namespaceof < PublicConstructor > ( ) )
207
+ . And ( )
208
+ . DoNotHaveParameterlessConstructor ( ) . GetReflectionTypes ( ) ;
209
+
210
+ Assert . Equal ( 1 , result . Count ( ) ) ;
211
+ Assert . Contains < Type > ( typeof ( PublicConstructorOneArgument ) , result ) ;
181
212
}
182
213
}
183
214
}
0 commit comments