Fixed some unit tests (not sure when they broke)
This commit is contained in:
parent
19be1193a1
commit
0d856d10e3
2 changed files with 8 additions and 2 deletions
|
|
@ -67,7 +67,7 @@ public class QueryableExtensionsTests
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(true, 2)]
|
[InlineData(true, 2)]
|
||||||
[InlineData(false, 1)]
|
[InlineData(false, 2)]
|
||||||
public void RestrictAgainstAgeRestriction_Genre_ShouldRestrictEverythingAboveTeen(bool includeUnknowns, int expectedCount)
|
public void RestrictAgainstAgeRestriction_Genre_ShouldRestrictEverythingAboveTeen(bool includeUnknowns, int expectedCount)
|
||||||
{
|
{
|
||||||
var items = new List<Genre>()
|
var items = new List<Genre>()
|
||||||
|
|
@ -94,7 +94,7 @@ public class QueryableExtensionsTests
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(true, 2)]
|
[InlineData(true, 2)]
|
||||||
[InlineData(false, 1)]
|
[InlineData(false, 2)]
|
||||||
public void RestrictAgainstAgeRestriction_Tag_ShouldRestrictEverythingAboveTeen(bool includeUnknowns, int expectedCount)
|
public void RestrictAgainstAgeRestriction_Tag_ShouldRestrictEverythingAboveTeen(bool includeUnknowns, int expectedCount)
|
||||||
{
|
{
|
||||||
var items = new List<Tag>()
|
var items = new List<Tag>()
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,12 @@ public static class RestrictByAgeExtensions
|
||||||
sm.Metadata.AgeRating <= restriction.AgeRating && sm.Metadata.AgeRating > AgeRating.Unknown));
|
sm.Metadata.AgeRating <= restriction.AgeRating && sm.Metadata.AgeRating > AgeRating.Unknown));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns all Genres where any of the linked Series/Chapters are less than or equal to restriction age rating
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="queryable"></param>
|
||||||
|
/// <param name="restriction"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static IQueryable<Genre> RestrictAgainstAgeRestriction(this IQueryable<Genre> queryable, AgeRestriction restriction)
|
public static IQueryable<Genre> RestrictAgainstAgeRestriction(this IQueryable<Genre> queryable, AgeRestriction restriction)
|
||||||
{
|
{
|
||||||
if (restriction.AgeRating == AgeRating.NotApplicable) return queryable;
|
if (restriction.AgeRating == AgeRating.NotApplicable) return queryable;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue