mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
updated eloquera's test setup.
This commit is contained in:
parent
23b90ae1c4
commit
d13f977bb5
8 changed files with 92 additions and 147 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue