using FluentAssertions; using NUnit.Framework; using Strata.ContinuousImprovement.Biz.Pagination; using Strata.ContinuousImprovement.JazzEntityFrameworkStub; using System.Linq; namespace Strata.ContinuousImprovement.Biz.Test.Unit.Pagination { [TestFixture, Category("Unit")] public class IQueryableExtensionsTest { [SetUp] public void TestSetUp() { // Method intentionally left empty. } [Test] public void TestIQueryableOrderBy() { // arrange var jeff = new JazzEntityFrameworkFactory(); var _opportunities = jeff.UVOpportunities.OrderByDescending(o => o.OpportunityKey); var list = _opportunities.AsQueryable() .OrderBy("OpportunityKey"); // act // assert list.First().OpportunityKey.Should().Be(_opportunities.Last().OpportunityKey); } [Test] public void TestIQueryableOrderByDescending() { // arrange var jeff = new JazzEntityFrameworkFactory(); var _opportunities = jeff.UVOpportunities.OrderBy(o => o.OpportunityKey); var list = _opportunities.AsQueryable() .OrderByDescending("OpportunityKey"); // act // assert list.First().OpportunityKey.Should().Be(_opportunities.Last().OpportunityKey); } [TearDown] public void TestTearDown() { // Method intentionally left empty. } } }