Custom filters/sorts case-insensitivity

This commit is contained in:
Biarity
2018-02-11 13:35:33 +10:00
parent bafee2314e
commit 3068c476e1
5 changed files with 21 additions and 7 deletions

View File

@@ -87,6 +87,20 @@ namespace SieveUnitTests
Assert.AreEqual(result.First().Id, 1);
Assert.IsTrue(result.Count() == 1);
}
[TestMethod]
public void CustomFiltersWork()
{
var model = new SieveModel()
{
Filters = "Isnew",
};
var result = _processor.ApplyFiltering(model, _posts);
Assert.IsFalse(result.Any(p => p.Id == 0));
Assert.IsTrue(result.Count() == 2);
}
}
}

View File

@@ -11,8 +11,7 @@ namespace SieveUnitTests.Services
{
public IQueryable<Post> IsNew(IQueryable<Post> source, string op, string value)
{
var result = source.Where(p => p.LikeCount < 100 &&
p.CommentCount < 5);
var result = source.Where(p => p.LikeCount < 100);
return result;
}