added test for not support.
This commit is contained in:
parent
c300906c5e
commit
19858764a3
@ -118,6 +118,34 @@ namespace PoweredSoft.DynamicQuery.Test
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SimpleFilterWithNot()
|
||||
{
|
||||
MockContextFactory.SeedAndTestContextFor("AsyncTests_SimpleFilter2", TestSeeders.SimpleSeedScenario, async ctx =>
|
||||
{
|
||||
var resultShouldMatch = ctx.Items.Where(t => !t.Name.EndsWith("Cables")).ToList();
|
||||
|
||||
var criteria = new QueryCriteria()
|
||||
{
|
||||
Filters = new List<IFilter>
|
||||
{
|
||||
new SimpleFilter
|
||||
{
|
||||
Path = "Name",
|
||||
Type = FilterType.EndsWith,
|
||||
Value = "Cables",
|
||||
Not = true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var asyncService = new AsyncQueryableService(new[] { new AsyncQueryableHandlerService() });
|
||||
var queryHandler = new QueryHandlerAsync(asyncService);
|
||||
var result = await queryHandler.ExecuteAsync(ctx.Items, criteria);
|
||||
Assert.Equal(resultShouldMatch, result.Data);
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestPaging()
|
||||
{
|
||||
|
@ -140,10 +140,11 @@ namespace PoweredSoft.DynamicQuery.Test
|
||||
Count++;
|
||||
}
|
||||
|
||||
public async Task AfterReadAsync(List<Tuple<Ticket, object>> pairs, CancellationToken cancellationToken = default(CancellationToken))
|
||||
public Task AfterReadAsync(List<Tuple<Ticket, object>> pairs, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
Test2 = true;
|
||||
Count++;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public void AfterReadEntity(List<Ticket> entities)
|
||||
@ -152,10 +153,11 @@ namespace PoweredSoft.DynamicQuery.Test
|
||||
Count++;
|
||||
}
|
||||
|
||||
public async Task AfterReadEntityAsync(List<Ticket> entities, CancellationToken cancellationToken = default(CancellationToken))
|
||||
public Task AfterReadEntityAsync(List<Ticket> entities, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
Test4 = true;
|
||||
Count++;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public object InterceptResultTo(Ticket entity)
|
||||
|
Loading…
Reference in New Issue
Block a user