public void ValidElements_ShouldSucceed() { var r = NonEmptyOrderByCollection.TryCreate(new List <OrderBy> { OrderBy.Create((NonEmptyString)"c1", true), OrderBy.Create((NonEmptyString)"c2", true) }.ToImmutableList()); r.IsSuccess.ShouldBeTrue(); }
public void ItShouldBePossibleToImplicitlyCastNonEmptyOrderByCollectionToOrderByCollection() { var value = Extensions.GetValue(() => NonEmptyOrderByCollection.TryCreate(new List <OrderBy> { OrderBy.Create((NonEmptyString)"c1", true) }.ToImmutableList())); OrderByCollection castResult = value; castResult.ShouldBeOfType <OrderByCollection>(); }
public void TwoNonEmptyOrderByCollectionsWithDiffrentValueShouldNotBeEqual() { var r1 = NonEmptyOrderByCollection.TryCreate(new List <OrderBy> { OrderBy.Create((NonEmptyString)"c", true) }.ToImmutableList()); var r2 = NonEmptyOrderByCollection.TryCreate(new List <OrderBy> { OrderBy.Create((NonEmptyString)"cx", true) }.ToImmutableList()); Helper.ShouldNotBeEqual(r1, r2); }
public void Empty_ShouldFail() { var r = NonEmptyOrderByCollection.TryCreate(new List <OrderBy>().ToImmutableList()); r.IsFailure.ShouldBeTrue(); }
private static NonEmptyOrderByCollection GetDefaultSort(string column) { return(Extensions.GetValue(() => NonEmptyOrderByCollection.TryCreate(new List <OrderBy> { OrderBy.Create((NonEmptyString)column, true) }.ToImmutableList()))); }