Merge pull request #60 from skolmer/generics

Added support for generic filter and sort methods
This commit is contained in:
Biarity
2019-11-16 10:55:18 +10:00
committed by GitHub
8 changed files with 94 additions and 11 deletions

View File

@@ -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()
{