public void ValueFilter_Builds_Ok([CombinatorialValues(1.0f, 2.0d, 3L, 4, "test")] object value, ComparisonOperator comparisonOperator, Comparator comparator) { var expected = $"ValueFilter ({comparisonOperator.GetComparisonOperatorString()},'{comparator.GetComparatorString()}{value}')"; var filter = new ValueFilter(); filter.Comparator(comparator); filter.ComparisonOperator(comparisonOperator); filter.Value(value); var validator = filter.ToFilterBuild(); var build = validator.Build(); Assert.Equal(expected, build); }
public void ValueFilter_Validates_Ok(ComparisonOperator comparison, Comparator comparator) { var filter = new ValueFilter(); filter.Comparator(comparator); filter.ComparisonOperator(comparison); filter.Value("test"); var validator = filter.ToFilterBuild(); var isSpecialCase = filter.ValidateOperationForComparator(comparator, comparison); if (!isSpecialCase) { Assert.Throws <FilterException>(() => validator.Validate()); } else { validator.Validate(); } }