From b2a042bd308b5d69a7fefe7283bf870e9b7ef88b Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 21 Feb 2012 16:55:21 -0800 Subject: [PATCH] Another Plex test, slight name change for some. --- .../ProviderTests/PlexProviderTest.cs | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/NzbDrone.Core.Test/ProviderTests/PlexProviderTest.cs b/NzbDrone.Core.Test/ProviderTests/PlexProviderTest.cs index 3621c7e1b..d0629f4f4 100644 --- a/NzbDrone.Core.Test/ProviderTests/PlexProviderTest.cs +++ b/NzbDrone.Core.Test/ProviderTests/PlexProviderTest.cs @@ -122,7 +122,7 @@ namespace NzbDrone.Core.Test.ProviderTests } [Test] - public void Notify_should_send_update_for_single_client_when_only_one_is_configured() + public void Notify_should_send_notification_for_single_client_when_only_one_is_configured() { //Setup WithSingleClient(); @@ -144,7 +144,7 @@ namespace NzbDrone.Core.Test.ProviderTests } [Test] - public void Notify_should_send_update_to_all_configured_clients() + public void Notify_should_send_notifcation_to_all_configured_clients() { //Setup WithMultipleClients(); @@ -152,8 +152,6 @@ namespace NzbDrone.Core.Test.ProviderTests const string header = "Test Header"; const string message = "Test Message"; - var expectedUrl = String.Format("http://localhost:3000/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification({0}, {1}))", header, message); - var fakeHttp = Mocker.GetMock(); fakeHttp.Setup(s => s.DownloadString(It.IsAny())) .Returns("ok"); @@ -187,5 +185,26 @@ namespace NzbDrone.Core.Test.ProviderTests //Assert fakeHttp.Verify(v => v.DownloadString(expectedUrl, "plex", "plex"), Times.Once()); } + + [Test] + public void Notify_should_send_notification_with_credentials_when_configured_for_all_clients() + { + //Setup + WithMultipleClients(); + WithClientCredentials(); + + const string header = "Test Header"; + const string message = "Test Message"; + + var fakeHttp = Mocker.GetMock(); + fakeHttp.Setup(s => s.DownloadString(It.IsAny(), "plex", "plex")) + .Returns("ok"); + + //Act + Mocker.Resolve().Notify(header, message); + + //Assert + fakeHttp.Verify(v => v.DownloadString(It.IsAny(), "plex", "plex"), Times.Exactly(2)); + } } } \ No newline at end of file