mirror of
https://github.com/Biarity/Sieve.git
synced 2025-11-06 19:55:34 +01:00
Merge pull request #60 from skolmer/generics
Added support for generic filter and sort methods
This commit is contained in:
@@ -207,6 +207,20 @@ namespace SieveUnitTests
|
||||
Assert.IsTrue(result.Count() == 3);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CustomGenericFiltersWork()
|
||||
{
|
||||
var model = new SieveModel()
|
||||
{
|
||||
Filters = "Latest",
|
||||
};
|
||||
|
||||
var result = _processor.Apply(model, _comments);
|
||||
|
||||
Assert.IsFalse(result.Any(p => p.Id == 0));
|
||||
Assert.IsTrue(result.Count() == 2);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CustomFiltersWithOperatorsWork()
|
||||
{
|
||||
@@ -286,6 +300,19 @@ namespace SieveUnitTests
|
||||
Assert.IsFalse(result.First().Id == 0);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CustomGenericSortsWork()
|
||||
{
|
||||
var model = new SieveModel()
|
||||
{
|
||||
Sorts = "Oldest",
|
||||
};
|
||||
|
||||
var result = _processor.Apply(model, _posts);
|
||||
|
||||
Assert.IsTrue(result.Last().Id == 0);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void MethodNotFoundExceptionWork()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user