You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
using System;
|
|
using System.ComponentModel;
|
|
using System.Linq.Expressions;
|
|
using FluentAssertions;
|
|
using NUnit.Framework;
|
|
using NzbDrone.Core.Datastore;
|
|
using NzbDrone.Core.Tv;
|
|
|
|
namespace NzbDrone.Core.Test.Datastore.PagingSpecExtenstionsTests
|
|
{
|
|
public class ToSortDirectionFixture
|
|
{
|
|
[Test]
|
|
public void should_convert_ascending_to_asc()
|
|
{
|
|
var pagingSpec = new PagingSpec<Episode>
|
|
{
|
|
Page = 1,
|
|
PageSize = 10,
|
|
SortDirection = SortDirection.Ascending,
|
|
SortKey = "AirDate"
|
|
};
|
|
|
|
pagingSpec.ToSortDirection().Should().Be(Marr.Data.QGen.SortDirection.Asc);
|
|
}
|
|
|
|
[Test]
|
|
public void should_convert_descending_to_desc()
|
|
{
|
|
var pagingSpec = new PagingSpec<Episode>
|
|
{
|
|
Page = 1,
|
|
PageSize = 10,
|
|
SortDirection = SortDirection.Descending,
|
|
SortKey = "AirDate"
|
|
};
|
|
|
|
pagingSpec.ToSortDirection().Should().Be(Marr.Data.QGen.SortDirection.Desc);
|
|
}
|
|
}
|
|
}
|