Exemple #1
0
        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();
        }
Exemple #2
0
        public void ItShouldBePossibleToImplicitlyCastNonEmptyOrderByCollectionToOrderByCollection()
        {
            var value = Extensions.GetValue(() => NonEmptyOrderByCollection.TryCreate(new List <OrderBy> {
                OrderBy.Create((NonEmptyString)"c1", true)
            }.ToImmutableList()));
            OrderByCollection castResult = value;

            castResult.ShouldBeOfType <OrderByCollection>();
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        public void Empty_ShouldFail()
        {
            var r = NonEmptyOrderByCollection.TryCreate(new List <OrderBy>().ToImmutableList());

            r.IsFailure.ShouldBeTrue();
        }
Exemple #5
0
 private static NonEmptyOrderByCollection GetDefaultSort(string column)
 {
     return(Extensions.GetValue(() => NonEmptyOrderByCollection.TryCreate(new List <OrderBy> {
         OrderBy.Create((NonEmptyString)column, true)
     }.ToImmutableList())));
 }