mirror of
				https://github.com/Biarity/Sieve.git
				synced 2025-10-31 00:39:12 +01:00 
			
		
		
		
	Release Sieve 2.5.0 (#151)
* Setup release 2.5.0 with automated build and pre-releases * #80 added support for escaping pipe control characters (#113) * #80 added support for escaping comma and pipe control characters * Update SieveModel.cs Fix build. Accidentally broken by resolving conflicts. * Migrate UnitTests to xUnit Co-authored-by: Clayton Andersen <candersen@restaurant365.com> Co-authored-by: ITDancer13 <kevin@ksommer.eu> Co-authored-by: ITDancer139 <kevinitdancersommer@gmail.com> * SieveProcessor.Options made protected property (#134) Mapper assignment in constructor is moved to a null-coalescing member pair (a field and a property) "IncludeScopes" switch is removed from appSettings.{env}.json files * Revert to _mapper assignment in constructor. (#140) * reverting fix (#142) * Revert to _mapper assignment in constructor. * reverting fix * pass filter values as parameters (#112) make GetClosureOverConstant really work * Make ApplyFiltering, ApplySorting and ApplyPagination protected virtual #139 (#144) * stop excluding null values when filtering using notEqual (#114) * stop excluding null values when filtering using notEqual * add IgnoreNullsOnNotEqual config field, to enable/disable the new feature Co-authored-by: AnasZakarneh <a.zakarneh@foothillsolutions.com> Co-authored-by: Clayton Andersen <tunaman65@gmail.com> Co-authored-by: Clayton Andersen <candersen@restaurant365.com> Co-authored-by: ITDancer139 <kevinitdancersommer@gmail.com> Co-authored-by: Hasan Manzak <hasan.manzak@gmail.com> Co-authored-by: alicak <alicak@users.noreply.github.com> Co-authored-by: AnasZakarneh <Zakarnehanas1@gmail.com> Co-authored-by: AnasZakarneh <a.zakarneh@foothillsolutions.com>
This commit is contained in:
		| @@ -16,16 +16,24 @@ namespace SieveUnitTests | ||||
|     { | ||||
|         private readonly ITestOutputHelper _testOutputHelper; | ||||
|         private readonly SieveProcessor _processor; | ||||
|         private readonly SieveProcessor _nullableProcessor; | ||||
|         private readonly IQueryable<IPost> _posts; | ||||
|         private readonly IQueryable<Comment> _comments; | ||||
|  | ||||
|         public GeneralWithInterfaces(ITestOutputHelper testOutputHelper) | ||||
|         { | ||||
|             var nullableAccessor = new SieveOptionsAccessor(); | ||||
|             nullableAccessor.Value.IgnoreNullsOnNotEqual = false; | ||||
|  | ||||
|             _testOutputHelper = testOutputHelper; | ||||
|             _processor = new ApplicationSieveProcessor(new SieveOptionsAccessor(), | ||||
|                 new SieveCustomSortMethods(), | ||||
|                 new SieveCustomFilterMethods()); | ||||
|  | ||||
|             _nullableProcessor = new ApplicationSieveProcessor(nullableAccessor, | ||||
|                 new SieveCustomSortMethods(), | ||||
|                 new SieveCustomFilterMethods()); | ||||
|  | ||||
|             _posts = new List<IPost> | ||||
|             { | ||||
|                 new Post | ||||
| @@ -181,8 +189,25 @@ namespace SieveUnitTests | ||||
|             }; | ||||
|  | ||||
|             var result = _processor.Apply(model, _posts); | ||||
|             var nullableResult = _nullableProcessor.Apply(model, _posts); | ||||
|  | ||||
|             Assert.True(result.Count() == 2); | ||||
|             Assert.True(nullableResult.Count() == 2); | ||||
|         } | ||||
|  | ||||
|         [Fact] | ||||
|         public void CanFilterNullableIntsWithNotEqual() | ||||
|         { | ||||
|             var model = new SieveModel() | ||||
|             { | ||||
|                 Filters = "CategoryId!=1" | ||||
|             }; | ||||
|  | ||||
|             var result = _processor.Apply(model, _posts); | ||||
|             var nullableResult = _nullableProcessor.Apply(model, _posts); | ||||
|  | ||||
|             Assert.True(result.Count() == 1); | ||||
|             Assert.True(nullableResult.Count() == 2); | ||||
|         } | ||||
|  | ||||
|         [Fact] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user