Template
47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
using FluentAssertions;
|
|
using NUnit.Framework;
|
|
using Strata.ApiLib.Standard.Models;
|
|
using Strata.ContinuousImprovement.Biz.UtilizationVariation.Opportunities;
|
|
using Strata.ContinuousImprovement.JazzEntityFrameworkStub;
|
|
|
|
namespace Strata.ContinuousImprovement.Biz.Test.Unit.Pagination
|
|
{
|
|
[TestFixture, Category("Unit")]
|
|
public class PaginatedListTest
|
|
{
|
|
|
|
[SetUp]
|
|
public void TestSetUp()
|
|
{
|
|
// Method intentionally left empty.
|
|
}
|
|
|
|
[Test]
|
|
public void TestPaginatedList()
|
|
{
|
|
// arrange
|
|
var jeff = new JazzEntityFrameworkFactory();
|
|
var _opportunities = jeff.UVOpportunities;
|
|
var pagingInfo = new PagingInfo() { ResultsPerPage = 25, PageNumber = 1, TotalNumberOfResults = 2 };
|
|
var paginatedList = new PagedApiResponse<UVOpportunity>() { Data = _opportunities, PagingInfo = pagingInfo };
|
|
|
|
// act
|
|
|
|
// assert
|
|
paginatedList.PagingInfo.PageNumber.Should().Be(1);
|
|
paginatedList.PagingInfo.TotalPages.Should().Be(1);
|
|
paginatedList.PagingInfo.TotalNumberOfResults.Should().Be(2);
|
|
paginatedList.PagingInfo.ResultsPerPage.Should().Be(25);
|
|
paginatedList.Data.Should()
|
|
.AllBeOfType<UVOpportunity>()
|
|
.And.HaveCount(_opportunities.Count);
|
|
}
|
|
|
|
[TearDown]
|
|
public void TestTearDown()
|
|
{
|
|
// Method intentionally left empty.
|
|
}
|
|
}
|
|
}
|