2013-02-05 07:07:07 +03:00
|
|
|
using System;
|
2013-02-18 07:01:59 +03:00
|
|
|
using System.IO;
|
2013-02-05 07:07:07 +03:00
|
|
|
using NUnit.Framework;
|
|
|
|
using NzbDrone.Core.Model.Notification;
|
|
|
|
using NzbDrone.Test.Common;
|
|
|
|
|
|
|
|
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");
|
|
|
|
}
|
2013-02-18 07:01:59 +03:00
|
|
|
|
|
|
|
|
|
|
|
protected FileStream OpenRead(params string[] path)
|
|
|
|
{
|
|
|
|
return File.OpenRead(Path.Combine(path));
|
|
|
|
}
|
2013-02-05 07:07:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public abstract class CoreTest<TSubject> : CoreTest
|
|
|
|
{
|
|
|
|
[SetUp]
|
|
|
|
public void CoreTestSetup()
|
|
|
|
{
|
|
|
|
Subject = Mocker.Resolve<TSubject>();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected TSubject Subject { get; set; }
|
|
|
|
}
|
|
|
|
}
|