public void AsyncResolve() { var repo = ServiceProvider.GetService <FakeRepo>(); //special data setup var context = ServiceProvider.GetService <TestDbContext>(); context.Add(new User() { Id = 1, FirstName = "BobTheMan", LastName = "Turtle" }); context.Add(new User() { Id = 2, FirstName = "TheManDon", LastName = "Bear" }); context.SaveChanges(); var filter = new UserPrivateFilter { FuzzyMatchTerm = "TheMan" }; var users = repo.GetQueryable <User>(); var filtered = users.ResolveAsync(filter).Result; filtered.Value.Count().Should().Be(2); }
public void PrivateFilterVariableInFuzzySearch() { var repo = ServiceProvider.GetService <FakeRepo>(); //special data setup var context = ServiceProvider.GetService <TestDbContext>(); context.Add(new User() { Id = 1, FirstName = "BobTheMan", LastName = "Turtle" }); context.Add(new User() { Id = 2, FirstName = "TheManDon", LastName = "Bear" }); context.SaveChanges(); var filter = new UserPrivateFilter { FuzzyMatchTerm = "TheMan" }; var users = repo.GetQueryable <User>(); var filtered = users.Filter(filter).Resolve(); filtered.Value.Count().Should().Be(2); //TODO: We have a bug here where if you re-use the filter it blows up because it assigned a sort by property that doesnt exist in the filter filter = new UserPrivateFilter { FuzzyMatchTerm = "Turtle" }; users = repo.GetQueryable <User>(); filtered = users.Filter(filter).Resolve(); filtered.Value.Count().Should().Be(0); }