|
|
@ -9,6 +9,8 @@ using Ombi.Settings.Settings.Models;
|
|
|
|
using Ombi.Store.Entities.Requests;
|
|
|
|
using Ombi.Store.Entities.Requests;
|
|
|
|
using Ombi.Store.Repository;
|
|
|
|
using Ombi.Store.Repository;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
using MockQueryable;
|
|
|
|
|
|
|
|
using MockQueryable.Moq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Ombi.Schedule.Tests
|
|
|
|
namespace Ombi.Schedule.Tests
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -49,7 +51,7 @@ namespace Ombi.Schedule.Tests
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Settings.Setup(x => x.GetSettingsAsync()).ReturnsAsync(new IssueSettings { DeleteIssues = true, DaysAfterResolvedToDelete = 5 });
|
|
|
|
Settings.Setup(x => x.GetSettingsAsync()).ReturnsAsync(new IssueSettings { DeleteIssues = true, DaysAfterResolvedToDelete = 5 });
|
|
|
|
Repo.Setup(x => x.GetAll()).Returns(new EnumerableQuery<Issues>(issues));
|
|
|
|
Repo.Setup(x => x.GetAll()).Returns(new List<Issues>(issues).AsQueryable().BuildMock().Object);
|
|
|
|
await Job.Execute(null);
|
|
|
|
await Job.Execute(null);
|
|
|
|
|
|
|
|
|
|
|
|
Assert.That(issues.First().Status, Is.EqualTo(IssueStatus.Deleted));
|
|
|
|
Assert.That(issues.First().Status, Is.EqualTo(IssueStatus.Deleted));
|
|
|
@ -74,7 +76,7 @@ namespace Ombi.Schedule.Tests
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Settings.Setup(x => x.GetSettingsAsync()).ReturnsAsync(new IssueSettings { DeleteIssues = true, DaysAfterResolvedToDelete = 5 });
|
|
|
|
Settings.Setup(x => x.GetSettingsAsync()).ReturnsAsync(new IssueSettings { DeleteIssues = true, DaysAfterResolvedToDelete = 5 });
|
|
|
|
Repo.Setup(x => x.GetAll()).Returns(new EnumerableQuery<Issues>(issues));
|
|
|
|
Repo.Setup(x => x.GetAll()).Returns(new EnumerableQuery<Issues>(issues).AsQueryable().BuildMock().Object);
|
|
|
|
await Job.Execute(null);
|
|
|
|
await Job.Execute(null);
|
|
|
|
|
|
|
|
|
|
|
|
Assert.That(issues[0].Status, Is.Not.EqualTo(IssueStatus.Deleted));
|
|
|
|
Assert.That(issues[0].Status, Is.Not.EqualTo(IssueStatus.Deleted));
|
|
|
@ -100,7 +102,7 @@ namespace Ombi.Schedule.Tests
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Settings.Setup(x => x.GetSettingsAsync()).ReturnsAsync(new IssueSettings { DeleteIssues = true, DaysAfterResolvedToDelete = 5 });
|
|
|
|
Settings.Setup(x => x.GetSettingsAsync()).ReturnsAsync(new IssueSettings { DeleteIssues = true, DaysAfterResolvedToDelete = 5 });
|
|
|
|
Repo.Setup(x => x.GetAll()).Returns(new EnumerableQuery<Issues>(issues));
|
|
|
|
Repo.Setup(x => x.GetAll()).Returns(new EnumerableQuery<Issues>(issues).AsQueryable().BuildMock().Object);
|
|
|
|
await Job.Execute(null);
|
|
|
|
await Job.Execute(null);
|
|
|
|
|
|
|
|
|
|
|
|
Assert.That(issues[0].Status, Is.Not.EqualTo(IssueStatus.Deleted));
|
|
|
|
Assert.That(issues[0].Status, Is.Not.EqualTo(IssueStatus.Deleted));
|
|
|
|