2011-11-02 04:08:53 +01:00
|
|
|
|
using System;
|
2011-11-14 01:22:18 +01:00
|
|
|
|
|
2011-11-02 04:08:53 +01:00
|
|
|
|
using FizzWare.NBuilder;
|
|
|
|
|
using FluentAssertions;
|
|
|
|
|
using Moq;
|
|
|
|
|
using NUnit.Framework;
|
2013-02-25 00:47:57 +01:00
|
|
|
|
using NzbDrone.Core.ExternalNotification;
|
2011-11-02 04:08:53 +01:00
|
|
|
|
using NzbDrone.Core.Model;
|
|
|
|
|
using NzbDrone.Core.Providers;
|
2013-03-07 02:51:47 +01:00
|
|
|
|
|
2011-11-02 04:08:53 +01:00
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
2011-11-14 01:22:18 +01:00
|
|
|
|
using NzbDrone.Test.Common.AutoMoq;
|
2011-11-02 04:08:53 +01:00
|
|
|
|
|
|
|
|
|
// ReSharper disable InconsistentNaming
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
{
|
|
|
|
|
[Explicit]
|
|
|
|
|
[TestFixture]
|
2013-02-17 06:44:06 +01:00
|
|
|
|
public class GrowlProviderTest : CoreTest
|
2011-11-02 04:08:53 +01:00
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void Register_should_add_new_application_to_local_growl_instance()
|
|
|
|
|
{
|
|
|
|
|
//Setup
|
2011-12-15 05:15:53 +01:00
|
|
|
|
WithStrictMocker();
|
2011-11-02 04:08:53 +01:00
|
|
|
|
|
|
|
|
|
//Act
|
2011-12-15 05:15:53 +01:00
|
|
|
|
Mocker.Resolve<GrowlProvider>().Register("localhost", 23053, "");
|
2011-11-02 04:08:53 +01:00
|
|
|
|
|
|
|
|
|
//Assert
|
2011-12-15 05:15:53 +01:00
|
|
|
|
Mocker.VerifyAllMocks();
|
2011-11-02 04:08:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestNotification_should_send_a_message_to_local_growl_instance()
|
|
|
|
|
{
|
|
|
|
|
//Setup
|
2011-12-15 05:15:53 +01:00
|
|
|
|
WithStrictMocker();
|
2011-11-02 04:08:53 +01:00
|
|
|
|
|
|
|
|
|
//Act
|
2011-12-15 05:15:53 +01:00
|
|
|
|
Mocker.Resolve<GrowlProvider>().TestNotification("localhost", 23053, "");
|
2011-11-02 04:08:53 +01:00
|
|
|
|
|
|
|
|
|
//Assert
|
2011-12-15 05:15:53 +01:00
|
|
|
|
Mocker.VerifyAllMocks();
|
2011-11-02 04:08:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void OnGrab_should_send_a_message_to_local_growl_instance()
|
|
|
|
|
{
|
|
|
|
|
//Setup
|
2011-12-15 05:15:53 +01:00
|
|
|
|
WithStrictMocker();
|
2011-11-02 04:08:53 +01:00
|
|
|
|
|
|
|
|
|
//Act
|
2011-12-15 05:15:53 +01:00
|
|
|
|
Mocker.Resolve<GrowlProvider>().SendNotification("Episode Grabbed", "Series Title - 1x05 - Episode Title", "GRAB", "localhost", 23053, "");
|
2011-11-02 04:08:53 +01:00
|
|
|
|
|
|
|
|
|
//Assert
|
2011-12-15 05:15:53 +01:00
|
|
|
|
Mocker.VerifyAllMocks();
|
2011-11-02 04:08:53 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void OnDownload_should_send_a_message_to_local_growl_instance()
|
|
|
|
|
{
|
|
|
|
|
//Setup
|
2011-12-15 05:15:53 +01:00
|
|
|
|
WithStrictMocker();
|
2011-11-02 04:08:53 +01:00
|
|
|
|
|
|
|
|
|
//Act
|
2011-12-15 05:15:53 +01:00
|
|
|
|
Mocker.Resolve<GrowlProvider>().SendNotification("Episode Downloaded", "Series Title - 1x05 - Episode Title", "DOWNLOAD", "localhost", 23053, "");
|
2011-11-02 04:08:53 +01:00
|
|
|
|
|
|
|
|
|
//Assert
|
2011-12-15 05:15:53 +01:00
|
|
|
|
Mocker.VerifyAllMocks();
|
2011-11-02 04:08:53 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|