2013-06-12 18:37:05 -07:00
|
|
|
using NUnit.Framework;
|
2013-05-19 16:17:32 -07:00
|
|
|
using NzbDrone.Core.Notifications.Growl;
|
2011-11-01 20:08:53 -07:00
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
2013-06-12 18:37:05 -07:00
|
|
|
namespace NzbDrone.Core.Test.NotificationTests
|
2011-11-01 20:08:53 -07:00
|
|
|
{
|
|
|
|
[Explicit]
|
|
|
|
[TestFixture]
|
2013-02-16 21:44:06 -08:00
|
|
|
public class GrowlProviderTest : CoreTest
|
2011-11-01 20:08:53 -07:00
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void Register_should_add_new_application_to_local_growl_instance()
|
|
|
|
{
|
2013-03-28 15:07:09 -07:00
|
|
|
|
2013-04-14 22:27:51 -07:00
|
|
|
|
2011-11-01 20:08:53 -07:00
|
|
|
|
2013-03-28 15:07:09 -07:00
|
|
|
|
2011-12-14 20:15:53 -08:00
|
|
|
Mocker.Resolve<GrowlProvider>().Register("localhost", 23053, "");
|
2011-11-01 20:08:53 -07:00
|
|
|
|
2013-03-28 15:07:09 -07:00
|
|
|
|
2011-12-14 20:15:53 -08:00
|
|
|
Mocker.VerifyAllMocks();
|
2011-11-01 20:08:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestNotification_should_send_a_message_to_local_growl_instance()
|
|
|
|
{
|
2013-03-28 15:07:09 -07:00
|
|
|
|
2013-04-14 22:27:51 -07:00
|
|
|
|
2011-11-01 20:08:53 -07:00
|
|
|
|
2013-03-28 15:07:09 -07:00
|
|
|
|
2011-12-14 20:15:53 -08:00
|
|
|
Mocker.Resolve<GrowlProvider>().TestNotification("localhost", 23053, "");
|
2011-11-01 20:08:53 -07:00
|
|
|
|
2013-03-28 15:07:09 -07:00
|
|
|
|
2011-12-14 20:15:53 -08:00
|
|
|
Mocker.VerifyAllMocks();
|
2011-11-01 20:08:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void OnGrab_should_send_a_message_to_local_growl_instance()
|
|
|
|
{
|
2013-03-28 15:07:09 -07:00
|
|
|
|
2013-04-14 22:27:51 -07:00
|
|
|
|
2011-11-01 20:08:53 -07:00
|
|
|
|
2013-03-28 15:07:09 -07:00
|
|
|
|
2011-12-14 20:15:53 -08:00
|
|
|
Mocker.Resolve<GrowlProvider>().SendNotification("Episode Grabbed", "Series Title - 1x05 - Episode Title", "GRAB", "localhost", 23053, "");
|
2011-11-01 20:08:53 -07:00
|
|
|
|
2013-03-28 15:07:09 -07:00
|
|
|
|
2011-12-14 20:15:53 -08:00
|
|
|
Mocker.VerifyAllMocks();
|
2011-11-01 20:08:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void OnDownload_should_send_a_message_to_local_growl_instance()
|
|
|
|
{
|
2013-03-28 15:07:09 -07:00
|
|
|
|
2013-04-14 22:27:51 -07:00
|
|
|
|
2011-11-01 20:08:53 -07:00
|
|
|
|
2013-03-28 15:07:09 -07:00
|
|
|
|
2011-12-14 20:15:53 -08:00
|
|
|
Mocker.Resolve<GrowlProvider>().SendNotification("Episode Downloaded", "Series Title - 1x05 - Episode Title", "DOWNLOAD", "localhost", 23053, "");
|
2011-11-01 20:08:53 -07:00
|
|
|
|
2013-03-28 15:07:09 -07:00
|
|
|
|
2011-12-14 20:15:53 -08:00
|
|
|
Mocker.VerifyAllMocks();
|
2011-11-01 20:08:53 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|