Example #1
0
        /// <summary>
        /// Implements the Ignore operation by adding values to the builder.
        /// </summary>
        /// <param name="parameterName">The name of the parameter to add.</param>
        /// <param name="type">An optional type to ignore.</param>
        /// <returns>A continuation of the configuration.</returns>
        private ParameterBuilder IgnoreImpl(string parameterName, Type type)
        {
            var value = new ParameterBuilderValue(parameterName, parameterName, type, null);

            value.Ignore = true;
            _values.Add(value);

            Provider.Add(this);

            return(this);
        }
Example #2
0
        /// <summary>
        /// Implements the And operation by adding values to the builder.
        /// </summary>
        /// <param name="parameterName">The name of the parameter to add.</param>
        /// <param name="alias">An optional alias of the parameter.</param>
        /// <param name="accessorExpression">An optional expression to use.</param>
        /// <returns>A continuation of the configuration.</returns>
        private ParameterBuilder AndImpl(string parameterName, string alias, LambdaExpression accessorExpression)
        {
            if (Alias == null)
            {
                Alias = alias;
            }

            var value = new ParameterBuilderValue(parameterName, alias, null, accessorExpression);

            _values.Add(value);

            Provider.Add(this);

            return(this);
        }
		private void ValidateValue(ParameterBuilderValue value, string alias, string parameterName, bool hasExpression)
		{
			Assert.That(value.Alias, Is.EqualTo(alias));
			Assert.That(value.ParameterName, Is.EqualTo(parameterName));
			Assert.AreEqual(hasExpression, value.Converter != null);
		}