From 16c9232b12e3eb2f95e57936f13a23f7a7bd5b6f Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Mon, 2 Sep 2013 21:55:04 -0700 Subject: [PATCH] update SQLiteMigrationHelperFixture --- .../Datastore/SQLiteMigrationHelperFixture.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/NzbDrone.Core.Test/Datastore/SQLiteMigrationHelperFixture.cs b/NzbDrone.Core.Test/Datastore/SQLiteMigrationHelperFixture.cs index 6f6dca730..386f63bf0 100644 --- a/NzbDrone.Core.Test/Datastore/SQLiteMigrationHelperFixture.cs +++ b/NzbDrone.Core.Test/Datastore/SQLiteMigrationHelperFixture.cs @@ -5,6 +5,7 @@ using NUnit.Framework; using NzbDrone.Core.Datastore.Migration.Framework; using NzbDrone.Core.Test.Framework; using NzbDrone.Core.Tv; +using System.Linq; namespace NzbDrone.Core.Test.Datastore { @@ -49,9 +50,10 @@ namespace NzbDrone.Core.Test.Datastore public void should_be_able_to_transfer_empty_tables() { var columns = _subject.GetColumns("Series"); + var indexes = _subject.GetIndexes("Series"); columns.Remove("Title"); - _subject.CreateTable("Series_New", columns.Values, new List()); + _subject.CreateTable("Series_New", columns.Values, indexes); _subject.CopyData("Series", "Series_New", columns.Values); @@ -65,9 +67,11 @@ namespace NzbDrone.Core.Test.Datastore Mocker.Resolve().InsertMany(originalEpisodes); var columns = _subject.GetColumns("Episodes"); + var indexes = _subject.GetIndexes("Episodes"); + columns.Remove("Title"); - _subject.CreateTable("Episodes_New", columns.Values, new List()); + _subject.CreateTable("Episodes_New", columns.Values, indexes); _subject.CopyData("Episodes", "Episodes_New", columns.Values); @@ -100,7 +104,7 @@ namespace NzbDrone.Core.Test.Datastore var newIndexes = _subject.GetIndexes("QualityB"); newIndexes.Should().HaveSameCount(indexes); - newIndexes.Should().BeEquivalentTo(columns); + newIndexes.Select(c=>c.Column).Should().BeEquivalentTo(indexes.Select(c=>c.Column)); } } } \ No newline at end of file