public void GetNumericValue_NotValidValue_ReturnsNull() { Int32Filter filter = new Int32Filter(); filter.Value = "1a"; Assert.Null(filter.GetNumericValue()); }
public void GetNumericValue_OnNotValidValueReturnsNull() { Int32Filter <GridModel> filter = new Int32Filter <GridModel>(); filter.Value = "1a"; Assert.IsNull(filter.GetNumericValue()); }
public void GetNumericValue_ParsesValue() { Int32Filter filter = new Int32Filter(); filter.Value = "-2147483648"; Object actual = filter.GetNumericValue(); Int32 expected = -2147483648; Assert.Equal(expected, actual); }
public void GetNumericValue_ParsesValue() { Int32Filter <GridModel> filter = new Int32Filter <GridModel>(); filter.Value = "-2147483648"; Object actual = filter.GetNumericValue(); Object expected = -2147483648; Assert.AreEqual(expected, actual); }
public void GetFilter_GetsFilterForNullableType() { IGridColumn <GridModel> column = Substitute.For <IGridColumn <GridModel> >(); Expression <Func <GridModel, Int32?> > expression = (model) => 0; column.Expression.Returns(expression); IGridFilter <GridModel> actual = filters.GetFilter <GridModel>(column, "Equals", "1"); IGridFilter <GridModel> expected = new Int32Filter <GridModel>(); expected.FilteredExpression = column.Expression; expected.Type = "Equals"; expected.Value = "1"; Assert.AreEqual(expected.FilteredExpression, actual.FilteredExpression); Assert.AreEqual(expected.ProcessorType, actual.ProcessorType); Assert.AreEqual(expected.GetType(), actual.GetType()); Assert.AreEqual(expected.Value, actual.Value); Assert.AreEqual(expected.Type, actual.Type); }