public void FilterById_Number()
        {
            TestDatalist<NumericModel> datalist = new TestDatalist<NumericModel>();
            for (Int32 i = 0; i < 20; i++)
                datalist.Models.Add(new NumericModel { Id = i });

            datalist.Filter.Id = "9.0";

            IQueryable<NumericModel> expected = datalist.GetModels().Where(model => model.Id == 9);
            IQueryable<NumericModel> actual = datalist.FilterById(datalist.GetModels());

            Assert.Equal(expected, actual);
        }
        public void FilterById_NoIdProperty_Throws()
        {
            TestDatalist<NoIdModel> datalist = new TestDatalist<NoIdModel>();

            DatalistException exception = Assert.Throws<DatalistException>(() => datalist.FilterById(null));

            String expected = $"'{typeof(NoIdModel).Name}' type does not have property named 'Id', required for automatic id filtering.";
            String actual = exception.Message;

            Assert.Equal(expected, actual);
        }