From 370ab86dca88b250f58f45760efc0977f04c2821 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Thu, 2 May 2013 21:40:22 -0700 Subject: [PATCH] fixed broken test --- .../Datastore/DatabaseRelationshipFixture.cs | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/NzbDrone.Core.Test/Datastore/DatabaseRelationshipFixture.cs b/NzbDrone.Core.Test/Datastore/DatabaseRelationshipFixture.cs index a98f8e9eb..dd71dd614 100644 --- a/NzbDrone.Core.Test/Datastore/DatabaseRelationshipFixture.cs +++ b/NzbDrone.Core.Test/Datastore/DatabaseRelationshipFixture.cs @@ -13,64 +13,64 @@ namespace NzbDrone.Core.Test.Datastore [TestFixture] public class DatabaseRelationshipFixture : DbTest { -/* [Test] - [Explicit] - public void benchmark() - { - var series = Builder.CreateNew() - .With(c => c.Id = 0) - .Build(); + /* [Test] + [Explicit] + public void benchmark() + { + var series = Builder.CreateNew() + .With(c => c.Id = 0) + .Build(); - Marr.Data.MapRepository.Instance.EnableTraceLogging = false; + Marr.Data.MapRepository.Instance.EnableTraceLogging = false; - Db.Insert(series); + Db.Insert(series); - var covers = Builder.CreateListOfSize(5) - .All() - .With(c => c.SeriesId = series.Id) - .With(c => c.Id = 0) - .Build() - .ToList(); + var covers = Builder.CreateListOfSize(5) + .All() + .With(c => c.SeriesId = series.Id) + .With(c => c.Id = 0) + .Build() + .ToList(); - Db.InsertMany(covers); + Db.InsertMany(covers); - var loadedSeries = Db.Single(); + var loadedSeries = Db.Single(); - var sw = Stopwatch.StartNew(); - for (int i = 0; i < 10000; i++) - { - loadedSeries = Db.Single(); - var list = loadedSeries.Covers.Value; - } + var sw = Stopwatch.StartNew(); + for (int i = 0; i < 10000; i++) + { + loadedSeries = Db.Single(); + var list = loadedSeries.Covers.Value; + } - sw.Stop(); + sw.Stop(); - Console.WriteLine(sw.Elapsed); + Console.WriteLine(sw.Elapsed); - loadedSeries.Covers.Value.Should().HaveSameCount(covers); - } + loadedSeries.Covers.Value.Should().HaveSameCount(covers); + } - [Test] - public void one_to_many() - { - var series = Builder.CreateNew() - .With(c => c.Id = 0) - .Build(); + [Test] + public void one_to_many() + { + var series = Builder.CreateNew() + .With(c => c.Id = 0) + .Build(); - Db.Insert(series); + Db.Insert(series); - var covers = Builder.CreateListOfSize(5) - .All() - .With(c => c.SeriesId = series.Id) - .With(c => c.Id = 0) - .Build() - .ToList(); + var covers = Builder.CreateListOfSize(5) + .All() + .With(c => c.SeriesId = series.Id) + .With(c => c.Id = 0) + .Build() + .ToList(); - Db.InsertMany(covers); + Db.InsertMany(covers); - var loadedSeries = Db.Single(); - loadedSeries.Covers.Value.Should().HaveSameCount(covers); - }*/ + var loadedSeries = Db.Single(); + loadedSeries.Covers.Value.Should().HaveSameCount(covers); + }*/ [Test] public void one_to_one() @@ -93,7 +93,7 @@ public void one_to_one() var loadedEpisode = Db.Single().Episode.Value; loadedEpisode.Should().NotBeNull(); - loadedEpisode.ShouldHave().AllProperties().EqualTo(episode); + loadedEpisode.ShouldHave().AllProperties().But(c => c.SeriesTitle).EqualTo(episode); }