SignalR/Nancy/Owin/Mono

This commit is contained in:
kay.one 2013-05-05 14:24:33 -07:00
commit 87a5dc7869
40 changed files with 2375 additions and 76 deletions

View file

@ -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);
}
}
}