Template
chore: deploy initial code base
This commit is contained in:
+53
@@ -0,0 +1,53 @@
|
||||
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.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
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.
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user