added test for lazy loaded objects.

This commit is contained in:
kay.one 2013-04-10 21:38:45 -07:00
parent 684a72792a
commit b27217bcf4
2 changed files with 23 additions and 3 deletions

View file

@ -130,7 +130,7 @@ namespace NzbDrone.Core.Test.Framework
public interface ITestDatabase
{
void InsertMany<T>(IEnumerable<T> items) where T : ModelBase, new();
void Insert<T>(T item) where T : ModelBase, new();
T Insert<T>(T item) where T : ModelBase, new();
List<T> All<T>() where T : ModelBase, new();
T Single<T>() where T : ModelBase, new();
void Update<T>(T childModel) where T : ModelBase, new();
@ -151,9 +151,9 @@ namespace NzbDrone.Core.Test.Framework
new BasicRepository<T>(_dbConnection).InsertMany(items.ToList());
}
public void Insert<T>(T item) where T : ModelBase, new()
public T Insert<T>(T item) where T : ModelBase, new()
{
new BasicRepository<T>(_dbConnection).Insert(item);
return new BasicRepository<T>(_dbConnection).Insert(item);
}
public List<T> All<T>() where T : ModelBase, new()