OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.45k stars 2.41k forks source link

Add new tests and helper methods to LiquidTests for 'sort' and 'where' filters #17015

Closed MichaelPetrinolis closed 1 week ago

MichaelPetrinolis commented 1 week ago

Added three new test methods to the LiquidTests class:

  1. SortingContentItems_ShouldSortTheArrayOnIntegerField
  2. FilteringContentItems_ShouldFilterTheArrayOnBooleanField
  3. FilteringAndSortingContentItems_ShouldFilterAndSortTheArrayOnContentFields

Introduced a static property FakeContentItems to generate fake content items for testing.

Added a static method CreateFakeContentItem to create a fake content item with specified order and boolean field values.

tests for the #16922 bug