mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-15 09:42:56 -07:00
more
This commit is contained in:
parent
7fdbc10ccc
commit
e6ec08052d
2 changed files with 45 additions and 2 deletions
|
@ -101,8 +101,40 @@ namespace Ombi.Core.Tests.Engine
|
||||||
Assert.That(data[0].Title, Is.EqualTo("Valid"));
|
Assert.That(data[0].Title, Is.EqualTo("Valid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[TestCaseSource(nameof(StatusTvColorData))]
|
||||||
|
public async Task<string> Calendar_Tv_StatusColor(AvailabilityTestModel model)
|
||||||
|
{
|
||||||
|
var tv = new List<ChildRequests>
|
||||||
|
{
|
||||||
|
new ChildRequests
|
||||||
|
{
|
||||||
|
SeasonRequests = new List<SeasonRequests>
|
||||||
|
{
|
||||||
|
new SeasonRequests
|
||||||
|
{
|
||||||
|
Episodes = new List<EpisodeRequests>
|
||||||
|
{
|
||||||
|
new EpisodeRequests
|
||||||
|
{
|
||||||
|
Title = "Valid",
|
||||||
|
AirDate = DateTime.Now,
|
||||||
|
Approved = model.Approved,
|
||||||
|
Available = model.Available
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
TvRepo.Setup(x => x.GetChild()).Returns(tv.AsQueryable());
|
||||||
|
var data = await CalendarEngine.GetCalendarData();
|
||||||
|
|
||||||
|
return data[0].BackgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
[TestCaseSource(nameof(StatusColorData))]
|
[TestCaseSource(nameof(StatusColorData))]
|
||||||
public async Task<string> Calendar_StatusColor(AvailabilityTestModel model)
|
public async Task<string> Calendar_Movie_StatusColor(AvailabilityTestModel model)
|
||||||
{
|
{
|
||||||
var movies = new List<MovieRequests>
|
var movies = new List<MovieRequests>
|
||||||
{
|
{
|
||||||
|
@ -130,6 +162,17 @@ namespace Ombi.Core.Tests.Engine
|
||||||
Approved = true,
|
Approved = true,
|
||||||
Denied = true
|
Denied = true
|
||||||
}).Returns("red").SetName("Calendar_DeniedRequest");
|
}).Returns("red").SetName("Calendar_DeniedRequest");
|
||||||
|
foreach (var testCaseData in StatusTvColorData)
|
||||||
|
{
|
||||||
|
yield return testCaseData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<TestCaseData> StatusTvColorData
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
yield return new TestCaseData(new AvailabilityTestModel
|
yield return new TestCaseData(new AvailabilityTestModel
|
||||||
{
|
{
|
||||||
Available = true,
|
Available = true,
|
||||||
|
|
|
@ -69,7 +69,7 @@ namespace Ombi.Core.Engine.V2
|
||||||
return viewModel;
|
return viewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetBackgroundColor(MovieRequests req)
|
private string GetBackgroundColor(BaseRequest req)
|
||||||
{
|
{
|
||||||
if (req.Available)
|
if (req.Available)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue