1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00
Sonarr/NzbDrone.Core.Test/ProviderTests/GrowlProviderTest.cs

74 lines
1.8 KiB
C#
Raw Normal View History

using System;
using FizzWare.NBuilder;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.ExternalNotification;
using NzbDrone.Core.Model;
using NzbDrone.Core.Providers;
2013-03-07 04:51:47 +03:00
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common.AutoMoq;
2013-03-29 01:07:09 +03:00
namespace NzbDrone.Core.Test.ProviderTests
{
[Explicit]
[TestFixture]
public class GrowlProviderTest : CoreTest
{
[Test]
public void Register_should_add_new_application_to_local_growl_instance()
{
2013-03-29 01:07:09 +03:00
2011-12-15 07:15:53 +03:00
WithStrictMocker();
2013-03-29 01:07:09 +03:00
2011-12-15 07:15:53 +03:00
Mocker.Resolve<GrowlProvider>().Register("localhost", 23053, "");
2013-03-29 01:07:09 +03:00
2011-12-15 07:15:53 +03:00
Mocker.VerifyAllMocks();
}
[Test]
public void TestNotification_should_send_a_message_to_local_growl_instance()
{
2013-03-29 01:07:09 +03:00
2011-12-15 07:15:53 +03:00
WithStrictMocker();
2013-03-29 01:07:09 +03:00
2011-12-15 07:15:53 +03:00
Mocker.Resolve<GrowlProvider>().TestNotification("localhost", 23053, "");
2013-03-29 01:07:09 +03:00
2011-12-15 07:15:53 +03:00
Mocker.VerifyAllMocks();
}
[Test]
public void OnGrab_should_send_a_message_to_local_growl_instance()
{
2013-03-29 01:07:09 +03:00
2011-12-15 07:15:53 +03:00
WithStrictMocker();
2013-03-29 01:07:09 +03:00
2011-12-15 07:15:53 +03:00
Mocker.Resolve<GrowlProvider>().SendNotification("Episode Grabbed", "Series Title - 1x05 - Episode Title", "GRAB", "localhost", 23053, "");
2013-03-29 01:07:09 +03:00
2011-12-15 07:15:53 +03:00
Mocker.VerifyAllMocks();
}
[Test]
public void OnDownload_should_send_a_message_to_local_growl_instance()
{
2013-03-29 01:07:09 +03:00
2011-12-15 07:15:53 +03:00
WithStrictMocker();
2013-03-29 01:07:09 +03:00
2011-12-15 07:15:53 +03:00
Mocker.Resolve<GrowlProvider>().SendNotification("Episode Downloaded", "Series Title - 1x05 - Episode Title", "DOWNLOAD", "localhost", 23053, "");
2013-03-29 01:07:09 +03:00
2011-12-15 07:15:53 +03:00
Mocker.VerifyAllMocks();
}
}
}