Migrations

Still need to remove System.Data.Sqlite, prefer an option in OrmLite to pluralize table names.
This commit is contained in:
markus101
2013-03-24 21:36:24 -07:00
committed by kay.one
parent b9fac94eca
commit 4bb4faf626
29 changed files with 375 additions and 50 deletions
@@ -78,7 +78,7 @@ namespace NzbDrone.Core.Test.JobTests
[Test]
public void running_scheduled_jobs_should_updates_last_execution_time()
{
GivenPendingJob(new List<JobDefinition> { new JobDefinition { TypeName = _fakeJob.GetType().FullName } });
GivenPendingJob(new List<JobDefinition> { new JobDefinition { Type = _fakeJob.GetType().FullName } });
Subject.EnqueueScheduled();
WaitForQueue();
@@ -91,7 +91,7 @@ namespace NzbDrone.Core.Test.JobTests
[Test]
public void failing_scheduled_job_should_mark_job_as_failed()
{
GivenPendingJob(new List<JobDefinition> { new JobDefinition { TypeName = _brokenJob.GetType().FullName } });
GivenPendingJob(new List<JobDefinition> { new JobDefinition { Type = _brokenJob.GetType().FullName } });
Subject.EnqueueScheduled();
WaitForQueue();
@@ -193,7 +193,7 @@ namespace NzbDrone.Core.Test.JobTests
[Test]
public void Item_added_to_queue_while_scheduler_runs_should_be_executed()
{
GivenPendingJob(new List<JobDefinition> { new JobDefinition { TypeName = _slowJob.GetType().FullName } });
GivenPendingJob(new List<JobDefinition> { new JobDefinition { Type = _slowJob.GetType().FullName } });
var jobThread = new Thread(Subject.EnqueueScheduled);
jobThread.Start();
@@ -219,7 +219,7 @@ namespace NzbDrone.Core.Test.JobTests
[Test]
public void scheduled_job_should_have_scheduler_as_source()
{
GivenPendingJob(new List<JobDefinition> { new JobDefinition { TypeName = _slowJob.GetType().FullName }, new JobDefinition { TypeName = _slowJob2.GetType().FullName } });
GivenPendingJob(new List<JobDefinition> { new JobDefinition { Type = _slowJob.GetType().FullName }, new JobDefinition { Type = _slowJob2.GetType().FullName } });
Subject.EnqueueScheduled();
Subject.Queue.Should().OnlyContain(c => c.Source == JobQueueItem.JobSourceType.Scheduler);
@@ -43,7 +43,7 @@ namespace NzbDrone.Core.Test.JobTests
Storage.All().Should().HaveCount(1);
StoredModel.Interval.Should().Be((Int32)_fakeJob.DefaultInterval.TotalMinutes);
StoredModel.Name.Should().Be(_fakeJob.Name);
StoredModel.TypeName.Should().Be(_fakeJob.GetType().ToString());
StoredModel.Type.Should().Be(_fakeJob.GetType().ToString());
StoredModel.LastExecution.Should().HaveYear(DateTime.Now.Year);
StoredModel.LastExecution.Should().HaveMonth(DateTime.Now.Month);
StoredModel.LastExecution.Should().HaveDay(DateTime.Today.Day);
@@ -66,7 +66,7 @@ namespace NzbDrone.Core.Test.JobTests
Subject.Init();
AllStoredModels.Should().HaveCount(1);
AllStoredModels.Should().NotContain(c => c.TypeName == deletedJob.TypeName);
AllStoredModels.Should().NotContain(c => c.Type == deletedJob.Type);
}
[Test]
@@ -88,7 +88,7 @@ namespace NzbDrone.Core.Test.JobTests
AllStoredModels.Should().HaveCount(1);
AllStoredModels.Should().NotContain(c => c.TypeName == deletedJob.TypeName);
AllStoredModels.Should().NotContain(c => c.Type == deletedJob.Type);
}
[Test]
@@ -98,7 +98,7 @@ namespace NzbDrone.Core.Test.JobTests
var oldJob = Builder<JobDefinition>.CreateNew()
.With(c => c.Id = 0)
.With(c => c.Name = "OldName")
.With(c => c.TypeName = typeof(FakeJob).ToString())
.With(c => c.Type = typeof(FakeJob).ToString())
.With(c => c.Interval = 0)
.With(c => c.Enable = true)
.With(c => c.Success = true)
@@ -116,7 +116,7 @@ namespace NzbDrone.Core.Test.JobTests
AllStoredModels.Should().HaveCount(1);
StoredModel.TypeName.Should().Be(newJob.GetType().FullName);
StoredModel.Type.Should().Be(newJob.GetType().FullName);
StoredModel.Name.Should().Be(newJob.Name);
StoredModel.Interval.Should().Be((int)newJob.DefaultInterval.TotalMinutes);
StoredModel.Enable.Should().Be(true);