public static void AddParameterValue(QualityCondition qualityCondition, [NotNull] string parameterName, [CanBeNull] Dataset value, string filterExpression = null, bool usedAsReferenceData = false) { Assert.ArgumentNotNullOrEmpty(parameterName, nameof(parameterName)); TestFactory factory = TestFactoryUtils.GetTestFactory(qualityCondition.TestDescriptor); TestParameter parameter = Assert.NotNull(factory).GetParameter(parameterName); TestParameterTypeUtils.AssertValidDataset(parameter, value); var parameterValue = new DatasetTestParameterValue(parameter, value, filterExpression, usedAsReferenceData); parameterValue.DataType = parameter.Type; qualityCondition.AddParameterValue(parameterValue); }
private static void AddScalarParameterValue(QualityCondition qualityCondition, [NotNull] string parameterName, [CanBeNull] object value) { Assert.ArgumentNotNullOrEmpty(parameterName, nameof(parameterName)); TestFactory factory = TestFactoryUtils.GetTestFactory(qualityCondition.TestDescriptor); TestParameter parameter = Assert.NotNull(factory).GetParameter(parameterName); if (!parameter.IsConstructorParameter && parameter.Type.IsValueType && (value == null || value as string == string.Empty)) { return; } var parameterValue = new ScalarTestParameterValue(parameter, value); parameterValue.DataType = parameter.Type; qualityCondition.AddParameterValue(parameterValue); }