some EloqueraDb cleanup

This commit is contained in:
Keivan Beigi 2013-02-12 17:25:32 -08:00 committed by kay.one
commit 5930a15d3a
6 changed files with 18 additions and 32 deletions

View file

@ -3,6 +3,7 @@ using Eloquera.Client;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Repository;
using NzbDrone.Core.Test.Framework;
@ -84,25 +85,26 @@ namespace NzbDrone.Core.Test.Datastore
[Test]
public void new_objects_should_get_id()
{
testSeries.Id = Db.InsertAndGetId(testSeries);
Db.Insert(testSeries);
testSeries.Id.Should().NotBe(0);
}
[Test]
public void should_have_id_when_returned_from_database()
{
testSeries.Id = Db.InsertAndGetId(testSeries);
Db.Insert(testSeries);
var item = Db.AsQueryable<Series>();
item.Should().HaveCount(1);
item.First().Id.Should().NotBe(0);
item.First().Id.Should().BeLessThan(100);
item.First().Id.Should().Be(testSeries.Id);
}
[Test]
public void should_be_able_to_find_object_by_id()
{
testSeries.Id = Db.InsertAndGetId(testSeries);
Db.Insert(testSeries);
var item = Db.AsQueryable<Series>().Single(c => c.Id == testSeries.Id);
item.Id.Should().NotBe(0);
@ -116,10 +118,8 @@ namespace NzbDrone.Core.Test.Datastore
}
}
public class UnknownType
public class UnknownType : BaseRepositoryModel
{
[ID]
public string Id;
public string Field1 { get; set; }
}
}