mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed most of the broken tests
This commit is contained in:
@@ -9,52 +9,6 @@ using PetaPoco;
|
||||
|
||||
namespace NzbDrone.Core.Test.Framework
|
||||
{
|
||||
|
||||
public abstract class CoreTest : TestBase
|
||||
{
|
||||
protected static ProgressNotification MockNotification
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ProgressNotification("Mock notification");
|
||||
}
|
||||
}
|
||||
|
||||
protected static void ThrowException()
|
||||
{
|
||||
throw new ApplicationException("This is a message for test exception");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public abstract class CoreTest<TSubject> : CoreTest
|
||||
{
|
||||
private TSubject _subject;
|
||||
|
||||
|
||||
protected TSubject Subject
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_subject == null)
|
||||
{
|
||||
_subject = Mocker.Resolve<TSubject>();
|
||||
}
|
||||
|
||||
return _subject;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void InitiateSubject()
|
||||
{
|
||||
_subject = Mocker.Resolve<TSubject>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public abstract class SqlCeTest : CoreTest
|
||||
{
|
||||
private string _dbTemplateName;
|
||||
@@ -145,4 +99,31 @@ namespace NzbDrone.Core.Test.Framework
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class SqlCeTest<TSubject> : SqlCeTest where TSubject : class
|
||||
{
|
||||
|
||||
private TSubject _subject;
|
||||
|
||||
|
||||
protected TSubject Subject
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_subject == null)
|
||||
{
|
||||
_subject = Mocker.Resolve<TSubject>();
|
||||
}
|
||||
|
||||
return _subject;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void InitiateSubject()
|
||||
{
|
||||
_subject = Mocker.Resolve<TSubject>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user