public void Apply_BadUInt64Value_ReturnsNull(String value) { NumberFilter <UInt64> filter = new NumberFilter <UInt64> { Method = "equals", Values = value }; Assert.Null(filter.Apply(sumExpression.Body)); }
public void Apply_BadDecimalValue_ReturnsNull(String value) { NumberFilter <Decimal> filter = new NumberFilter <Decimal> { Method = "equals", Value = value }; Assert.Null(filter.Apply(sumExpression.Body)); }
public void Apply_EmptyValue_ReturnsNull() { NumberFilter <Int32> filter = new NumberFilter <Int32> { Method = "equals", Values = StringValues.Empty }; Assert.Null(filter.Apply(nSumExpression.Body)); }
public void Apply_BadSingleValue_ReturnsNull(String value) { NumberFilter <Single> filter = new NumberFilter <Single> { Method = "equals", Values = new[] { value } }; Assert.Null(filter.Apply(sumExpression.Body)); }
public void Apply_GreaterThanOrEqualFilter(String value, Int32?number) { NumberFilter <Int32> filter = new NumberFilter <Int32> { Method = "greater-than-or-equal", Value = value }; IEnumerable actual = Filter(items, filter.Apply(sumExpression.Body), sumExpression); IEnumerable expected = items.Where(model => model.Sum >= number); Assert.Equal(expected, actual); }
public void Apply_LessThanFilter(String value, Int32?number) { NumberFilter <Int32> filter = new NumberFilter <Int32> { Method = "less-than", Value = value }; IEnumerable actual = Filter(items, filter.Apply(sumExpression.Body), sumExpression); IEnumerable expected = items.Where(model => model.Sum < number); Assert.Equal(expected, actual); }
public void Apply_NullableNotEqualsFilter(String value, Int32?number) { NumberFilter <Int32> filter = new NumberFilter <Int32> { Method = "not-equals", Value = value }; IEnumerable actual = Filter(items, filter.Apply(nSumExpression.Body), nSumExpression); IEnumerable expected = items.Where(model => model.NSum != number); Assert.Equal(expected, actual); }
public void Apply_NullNumericValue_ReturnsNull() { filter.GetNumericValue().Returns(null); Assert.Null(filter.Apply(sumExpression.Body)); }