mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
SignalR/Nancy/Owin/Mono
This commit is contained in:
@@ -3,7 +3,9 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Marr.Data;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
@@ -140,25 +142,27 @@ namespace NzbDrone.Core.Test.Framework
|
||||
public class TestTestDatabase : ITestDatabase
|
||||
{
|
||||
private readonly IDatabase _dbConnection;
|
||||
private IMessageAggregator _messageAggregator;
|
||||
|
||||
public TestTestDatabase(IDatabase dbConnection)
|
||||
{
|
||||
_messageAggregator = new Mock<IMessageAggregator>().Object;
|
||||
_dbConnection = dbConnection;
|
||||
}
|
||||
|
||||
public void InsertMany<T>(IEnumerable<T> items) where T : ModelBase, new()
|
||||
{
|
||||
new BasicRepository<T>(_dbConnection).InsertMany(items.ToList());
|
||||
new BasicRepository<T>(_dbConnection, _messageAggregator).InsertMany(items.ToList());
|
||||
}
|
||||
|
||||
public T Insert<T>(T item) where T : ModelBase, new()
|
||||
{
|
||||
return new BasicRepository<T>(_dbConnection).Insert(item);
|
||||
return new BasicRepository<T>(_dbConnection, _messageAggregator).Insert(item);
|
||||
}
|
||||
|
||||
public List<T> All<T>() where T : ModelBase, new()
|
||||
{
|
||||
return new BasicRepository<T>(_dbConnection).All().ToList();
|
||||
return new BasicRepository<T>(_dbConnection, _messageAggregator).All().ToList();
|
||||
}
|
||||
|
||||
public T Single<T>() where T : ModelBase, new()
|
||||
@@ -168,12 +172,12 @@ namespace NzbDrone.Core.Test.Framework
|
||||
|
||||
public void Update<T>(T childModel) where T : ModelBase, new()
|
||||
{
|
||||
new BasicRepository<T>(_dbConnection).Update(childModel);
|
||||
new BasicRepository<T>(_dbConnection, _messageAggregator).Update(childModel);
|
||||
}
|
||||
|
||||
public void Delete<T>(T childModel) where T : ModelBase, new()
|
||||
{
|
||||
new BasicRepository<T>(_dbConnection).Delete(childModel);
|
||||
new BasicRepository<T>(_dbConnection, _messageAggregator).Delete(childModel);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user