updated eloquera's test setup.

This commit is contained in:
kay.one 2013-02-03 16:10:15 -08:00
parent 23b90ae1c4
commit d13f977bb5
8 changed files with 92 additions and 147 deletions

View file

@ -4,7 +4,6 @@ using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Repository;
using NzbDrone.Core.Test.Framework;
using Db4objects.Db4o.Linq;
namespace NzbDrone.Core.Test.Datastore
{
@ -14,7 +13,7 @@ namespace NzbDrone.Core.Test.Datastore
[SetUp]
public void SetUp()
{
WithObjectDb(false);
WithObjectDb();
}
[Test]
@ -25,7 +24,6 @@ namespace NzbDrone.Core.Test.Datastore
Db.Create(series);
Db.Ext().Purge();
Db.AsQueryable<Series>().Should().HaveCount(1);
@ -47,38 +45,6 @@ namespace NzbDrone.Core.Test.Datastore
}
[Test]
public void rollback_should_reset_state()
{
var episode = Builder<Episode>.CreateNew().Build();
Db.Create(episode);
Db.AsQueryable<Episode>().Should().HaveCount(1);
Db.Rollback();
Db.AsQueryable<Episode>().Should().HaveCount(0);
}
[Test]
public void roolback_should_only_roll_back_what_is_not_commited()
{
var episode = Builder<Episode>.CreateNew().Build();
var series = Builder<Series>.CreateNew().Build();
Db.Create(episode);
Db.Commit();
Db.Create(series);
Db.Rollback();
Db.AsQueryable<Episode>().Should().HaveCount(1);
Db.AsQueryable<Series>().Should().HaveCount(0);
}
[Test]
public void should_store_nested_objects()
@ -102,7 +68,7 @@ namespace NzbDrone.Core.Test.Datastore
episode.Series.Title = "UpdatedTitle";
Db.Update(episode, 2);
Db.Update(episode);
Db.AsQueryable<Episode>().Should().HaveCount(1);
Db.AsQueryable<Episode>().Single().Series.Should().NotBeNull();