mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
Fixed job provider existing job update bug.
This commit is contained in:
parent
98e8f4361e
commit
a7a7c4ab49
2 changed files with 22 additions and 17 deletions
|
@ -313,7 +313,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
|
|||
WithRealDb();
|
||||
var deletedJob = Builder<JobDefinition>.CreateNew()
|
||||
.With(c => c.Name = fakeJob.Name).Build();
|
||||
|
||||
|
||||
Db.Insert(deletedJob);
|
||||
var jobProvider = Mocker.Resolve<JobProvider>();
|
||||
|
||||
|
@ -334,9 +334,12 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
|
|||
|
||||
WithRealDb();
|
||||
var initialFakeJob = Builder<JobDefinition>.CreateNew()
|
||||
.With(c => c.Name = fakeJob.Name)
|
||||
.With(c => c.Name = "NewName")
|
||||
.With(c => c.TypeName = fakeJob.GetType().ToString())
|
||||
.With(c => c.Interval = 60)
|
||||
.With(c => c.Interval = 0)
|
||||
.With(c => c.Enable = false)
|
||||
.With(c => c.Success = true)
|
||||
.With(c => c.LastExecution = DateTime.Now.AddDays(-7).Date)
|
||||
.Build();
|
||||
|
||||
var id = Convert.ToInt32(Db.Insert(initialFakeJob));
|
||||
|
@ -349,8 +352,13 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
|
|||
//Assert
|
||||
var registeredJobs = Db.Fetch<JobDefinition>();
|
||||
registeredJobs.Should().HaveCount(1);
|
||||
registeredJobs.First().TypeName.Should().Be(fakeJob.GetType().ToString());
|
||||
registeredJobs.First().Name.Should().Be(fakeJob.Name);
|
||||
registeredJobs.First().Interval.Should().Be(fakeJob.DefaultInterval);
|
||||
registeredJobs.First().Id.Should().Be(id);
|
||||
|
||||
registeredJobs.First().Enable.Should().Be(true);
|
||||
registeredJobs.First().Success.Should().Be(initialFakeJob.Success);
|
||||
registeredJobs.First().LastExecution.Should().Be(initialFakeJob.LastExecution);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue