|
|
|
@ -429,6 +429,7 @@ namespace Ombi.Core.Tests.Engine
|
|
|
|
|
Id = "id1"
|
|
|
|
|
};
|
|
|
|
|
var lastWeek = new DateTime(2020, 09, 05).AddMonths(-1).AddDays(-1);
|
|
|
|
|
var today = new DateTime(2020, 09, 15, 13, 0, 0);
|
|
|
|
|
var log = new List<RequestLog>
|
|
|
|
|
{
|
|
|
|
|
new RequestLog
|
|
|
|
@ -441,7 +442,7 @@ namespace Ombi.Core.Tests.Engine
|
|
|
|
|
var repoMock = _mocker.GetMock<IRepository<RequestLog>>();
|
|
|
|
|
repoMock.Setup(x => x.GetAll()).Returns(log.AsQueryable().BuildMock().Object);
|
|
|
|
|
|
|
|
|
|
var result = await _subject.GetRemainingMovieRequests(user);
|
|
|
|
|
var result = await _subject.GetRemainingMovieRequests(user, today);
|
|
|
|
|
|
|
|
|
|
Assert.That(result, Is.InstanceOf<RequestQuotaCountModel>()
|
|
|
|
|
.With.Property(nameof(RequestQuotaCountModel.HasLimit)).EqualTo(true)
|
|
|
|
@ -474,7 +475,7 @@ namespace Ombi.Core.Tests.Engine
|
|
|
|
|
var repoMock = _mocker.GetMock<IRepository<RequestLog>>();
|
|
|
|
|
repoMock.Setup(x => x.GetAll()).Returns(log.AsQueryable().BuildMock().Object);
|
|
|
|
|
|
|
|
|
|
var result = await _subject.GetRemainingMovieRequests(user);
|
|
|
|
|
var result = await _subject.GetRemainingMovieRequests(user, today);
|
|
|
|
|
|
|
|
|
|
Assert.That(result, Is.InstanceOf<RequestQuotaCountModel>()
|
|
|
|
|
.With.Property(nameof(RequestQuotaCountModel.HasLimit)).EqualTo(true)
|
|
|
|
@ -514,7 +515,7 @@ namespace Ombi.Core.Tests.Engine
|
|
|
|
|
var repoMock = _mocker.GetMock<IRepository<RequestLog>>();
|
|
|
|
|
repoMock.Setup(x => x.GetAll()).Returns(log.AsQueryable().BuildMock().Object);
|
|
|
|
|
|
|
|
|
|
var result = await _subject.GetRemainingMovieRequests(user);
|
|
|
|
|
var result = await _subject.GetRemainingMovieRequests(user, today);
|
|
|
|
|
|
|
|
|
|
Assert.That(result, Is.InstanceOf<RequestQuotaCountModel>()
|
|
|
|
|
.With.Property(nameof(RequestQuotaCountModel.HasLimit)).EqualTo(true)
|
|
|
|
|