using Xunit; using Aurora; using Aurora.Services.Signal; using Aurora.Cursor; namespace AuroraSignal.test { public class CursorListTest { [Theory()] [InlineData(SortDirection.Asc)] [InlineData(SortDirection.Desc)] public void CursorListSortOnStringValue(SortDirection direction) { CursorList list = new CursorList(); list.Add(new Party() { Name = "asdf", Id = "1111" }); list.Add(new Party() { Name = "bsdf", Id = "2222" }); list.Add(new Party() { Name = "csdf", Id = "3333" }); CursorResult result = new Cursor(ref list) .WithSort(item => item.Value.Name, direction) .GetNextPage(); if (direction == SortDirection.Desc) { Assert.Collection(result.Result, item => item.Name.Equals("asdf"), item => item.Name.Equals("bsdf"), item => item.Name.Equals("csdf")); } else { Assert.Collection(result.Result, item => item.Name.Equals("csdf"), item => item.Name.Equals("bsdf"), item => item.Name.Equals("asdf")); } } } }