1- using System . Linq . Expressions ;
1+ using System . Linq . Expressions ;
22using System . Reflection ;
33
44using AutoFixture ;
@@ -167,8 +167,8 @@ protected virtual void Configure() { }
167167 /// </summary>
168168 protected void UsePlugin ( Func < Type , bool > predicate , Func < Type , IFixture , IValueCreationService , object ? > factory )
169169 {
170- ArgumentNullException . ThrowIfNull ( predicate ) ;
171- ArgumentNullException . ThrowIfNull ( factory ) ;
170+ ThrowIfNull ( predicate ) ;
171+ ThrowIfNull ( factory ) ;
172172 Plugins . Add ( new DelegateValueCreationPlugin ( predicate , factory ) ) ;
173173 }
174174
@@ -178,7 +178,7 @@ protected void UsePlugin(Func<Type, bool> predicate, Func<Type, IFixture, IValue
178178 /// </summary>
179179 protected void UsePlugin ( IValueCreationPlugin plugin )
180180 {
181- ArgumentNullException . ThrowIfNull ( plugin ) ;
181+ ThrowIfNull ( plugin ) ;
182182 Plugins . Add ( plugin ) ;
183183 }
184184
@@ -189,7 +189,7 @@ protected void UsePlugin(IValueCreationPlugin plugin)
189189 /// <typeparam name="TType">The exact type to handle.</typeparam>
190190 protected void UseValueFor < TType > ( Func < IFixture , TType ? > factory )
191191 {
192- ArgumentNullException . ThrowIfNull ( factory ) ;
192+ ThrowIfNull ( factory ) ;
193193 Plugins . Add ( new DelegateValueCreationPlugin (
194194 t => t == typeof ( TType ) ,
195195 ( type , fixture , svc ) => factory ( fixture ) ) ) ;
@@ -203,7 +203,7 @@ protected void UseValueFor<TType>(Func<IFixture, TType?> factory)
203203 /// <typeparam name="TType">The exact type to handle.</typeparam>
204204 protected void UseValueFor < TType > ( Func < IFixture , IValueCreationService , TType ? > factory )
205205 {
206- ArgumentNullException . ThrowIfNull ( factory ) ;
206+ ThrowIfNull ( factory ) ;
207207 Plugins . Add ( new DelegateValueCreationPlugin (
208208 t => t == typeof ( TType ) ,
209209 ( type , fixture , svc ) => factory ( fixture , svc ) ) ) ;
@@ -215,7 +215,7 @@ protected void UseValueFor<TType>(Func<IFixture, IValueCreationService, TType?>
215215 /// </summary>
216216 protected void UseStrategy ( ISpecimenBuilderStrategy strategy )
217217 {
218- ArgumentNullException . ThrowIfNull ( strategy ) ;
218+ ThrowIfNull ( strategy ) ;
219219 UserStrategies . Add ( strategy ) ;
220220 }
221221
@@ -226,7 +226,7 @@ protected void UseStrategy(ISpecimenBuilderStrategy strategy)
226226 /// </summary>
227227 protected void UseConstructorSelector ( IConstructorSelector selector )
228228 {
229- ArgumentNullException . ThrowIfNull ( selector ) ;
229+ ThrowIfNull ( selector ) ;
230230 RegisteredConstructorSelector = selector ;
231231 }
232232
@@ -237,7 +237,7 @@ protected void UseConstructorSelector(IConstructorSelector selector)
237237 /// </summary>
238238 protected void UseParameterPropertyMatcher ( IParameterPropertyMatcher matcher )
239239 {
240- ArgumentNullException . ThrowIfNull ( matcher ) ;
240+ ThrowIfNull ( matcher ) ;
241241 RegisteredParameterPropertyMatcher = matcher ;
242242 }
243243
@@ -251,8 +251,8 @@ protected void UseParameterPropertyMatcher(IParameterPropertyMatcher matcher)
251251 /// <param name="propertyExpression">The target property expression.</param>
252252 protected void MatchParameterToProperty < TProperty > ( string parameterName , Expression < Func < T , TProperty > > propertyExpression )
253253 {
254- ArgumentException . ThrowIfNullOrWhiteSpace ( parameterName ) ;
255- ArgumentNullException . ThrowIfNull ( propertyExpression ) ;
254+ ThrowIfNullOrWhiteSpace ( parameterName ) ;
255+ ThrowIfNull ( propertyExpression ) ;
256256
257257 var propertyName = PropertyExpressionParser . GetPropertyName ( propertyExpression ) ;
258258 ExplicitParameterPropertyMappings [ parameterName . Trim ( ) ] = propertyName ;
@@ -266,7 +266,7 @@ protected void MatchParameterToProperty<TProperty>(string parameterName, Express
266266 /// </summary>
267267 protected void UsePropertyExpressionParser ( IPropertyExpressionParser parser )
268268 {
269- ArgumentNullException . ThrowIfNull ( parser ) ;
269+ ThrowIfNull ( parser ) ;
270270 RegisteredPropertyExpressionParser = parser ;
271271 }
272272
@@ -279,7 +279,7 @@ protected void UsePropertyExpressionParser(IPropertyExpressionParser parser)
279279 /// </summary>
280280 protected void UsePropertyValueStore ( Func < IPropertyValueStore > factory )
281281 {
282- ArgumentNullException . ThrowIfNull ( factory ) ;
282+ ThrowIfNull ( factory ) ;
283283 RegisteredValueStoreFactory = factory ;
284284 }
285285
@@ -292,7 +292,7 @@ protected void UsePropertyValueStore(Func<IPropertyValueStore> factory)
292292 /// </summary>
293293 protected void UseValueCreationService ( IValueCreationService service )
294294 {
295- ArgumentNullException . ThrowIfNull ( service ) ;
295+ ThrowIfNull ( service ) ;
296296 RegisteredValueCreationService = service ;
297297 }
298298
@@ -318,7 +318,7 @@ protected void SetDefault<TProperty>(Expression<Func<T, TProperty>> propertyExpr
318318 /// </summary>
319319 protected void SetDefault < TProperty > ( Expression < Func < T , TProperty > > propertyExpression , Func < TProperty > valueFactory )
320320 {
321- ArgumentNullException . ThrowIfNull ( valueFactory ) ;
321+ ThrowIfNull ( valueFactory ) ;
322322 var propertyName = PropertyExpressionParser . GetPropertyName ( propertyExpression ) ;
323323 DefaultPropertyValueStore . SetValue ( propertyName , new ConfiguredValueFactory ( _ => valueFactory ( ) ) ) ;
324324 }
@@ -329,7 +329,7 @@ protected void SetDefault<TProperty>(Expression<Func<T, TProperty>> propertyExpr
329329 /// </summary>
330330 protected void SetDefault < TProperty > ( Expression < Func < T , TProperty > > propertyExpression , Func < IFixture , TProperty > valueFactory )
331331 {
332- ArgumentNullException . ThrowIfNull ( valueFactory ) ;
332+ ThrowIfNull ( valueFactory ) ;
333333 var propertyName = PropertyExpressionParser . GetPropertyName ( propertyExpression ) ;
334334 DefaultPropertyValueStore . SetValue ( propertyName , new ConfiguredValueFactory ( fixture => valueFactory ( fixture ) ) ) ;
335335 }
@@ -356,7 +356,7 @@ public TSelf With<TProperty>(Expression<Func<T, TProperty>> propertyExpression,
356356 /// </summary>
357357 public TSelf With < TProperty > ( Expression < Func < T , TProperty > > propertyExpression , Func < TProperty > valueFactory )
358358 {
359- ArgumentNullException . ThrowIfNull ( valueFactory ) ;
359+ ThrowIfNull ( valueFactory ) ;
360360 var propertyName = PropertyExpressionParser . GetPropertyName ( propertyExpression ) ;
361361 OverridePropertyValueStore . SetValue ( propertyName , new ConfiguredValueFactory ( _ => valueFactory ( ) ) ) ;
362362 return ( TSelf ) this ;
@@ -368,7 +368,7 @@ public TSelf With<TProperty>(Expression<Func<T, TProperty>> propertyExpression,
368368 /// </summary>
369369 public TSelf With < TProperty > ( Expression < Func < T , TProperty > > propertyExpression , Func < IFixture , TProperty > valueFactory )
370370 {
371- ArgumentNullException . ThrowIfNull ( valueFactory ) ;
371+ ThrowIfNull ( valueFactory ) ;
372372 var propertyName = PropertyExpressionParser . GetPropertyName ( propertyExpression ) ;
373373 OverridePropertyValueStore . SetValue ( propertyName , new ConfiguredValueFactory ( fixture => valueFactory ( fixture ) ) ) ;
374374 return ( TSelf ) this ;
@@ -521,7 +521,7 @@ protected virtual T CreateInstance(IFixture fixture)
521521
522522 private bool TryGetMappedPropertyName ( ParameterInfo parameter , out string propertyName )
523523 {
524- ArgumentNullException . ThrowIfNull ( parameter ) ;
524+ ThrowIfNull ( parameter ) ;
525525
526526 var parameterName = parameter . Name ;
527527 if ( string . IsNullOrWhiteSpace ( parameterName ) )
0 commit comments