/// <summary> /// Initializes a new instance of the /// <see cref="ParameterNullReferenceBehaviorExpectation"/> class. /// </summary> /// <param name="specimenBuilder">The anonymous object creation service used to workaround /// a problem with guard clause assertions.</param> /// <param name="guardClauseExtensions">An instance of helper extensions for the /// <see cref="GuardClauseAssertion"/> class.</param> /// <exception cref="ArgumentNullException"><paramref name="specimenBuilder"/>, or /// <paramref name="guardClauseExtensions"/> is <see langword="null"/>.</exception> public ParameterNullReferenceBehaviorExpectation( ISpecimenBuilder specimenBuilder, IGuardClauseExtensions guardClauseExtensions) { ParameterValidation.IsNotNull(specimenBuilder, nameof(specimenBuilder)); ParameterValidation.IsNotNull(guardClauseExtensions, nameof(guardClauseExtensions)); this.specimenBuilder = specimenBuilder; this.guardClauseExtensions = guardClauseExtensions; }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionBehaviorExpectation{T}"/> class. /// </summary> /// <param name="specimenBuilder">The anonymous object creation service used to workaround /// a problem with guard clause assertions.</param> /// <param name="guardClauseExtensions">An instance of helper extensions for the /// <see cref="GuardClauseAssertion"/> class.</param> /// <param name="parameterName">The name of the parameter to apply a known value to.</param> /// <param name="values">The values to apply to the parameter to assert the guard clause. /// </param> /// <exception cref="ArgumentNullException"><paramref name="specimenBuilder"/>, /// <paramref name="guardClauseExtensions"/>, <paramref name="parameterName"/>, or /// <paramref name="values"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentException"><paramref name="parameterName"/> is empty. /// </exception> /// <exception cref="ArgumentException"><paramref name="values"/> is empty.</exception> public ExceptionBehaviorExpectation( ISpecimenBuilder specimenBuilder, IGuardClauseExtensions guardClauseExtensions, string parameterName, params object[] values) { ParameterValidation.IsNotNull(specimenBuilder, nameof(specimenBuilder)); ParameterValidation.IsNotNull(guardClauseExtensions, nameof(guardClauseExtensions)); ParameterValidation.IsNotNull(parameterName, nameof(parameterName)); ParameterValidation.IsNotEmpty(parameterName, nameof(parameterName)); ParameterValidation.IsNotNull(values, nameof(values)); if (values.Length == 0) { throw new ArgumentException("Collection must not be empty.", nameof(values)); } this.specimenBuilder = specimenBuilder; this.ParameterName = parameterName; this.Values = values; this.guardClauseExtensions = guardClauseExtensions; }