1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

Fixed the broken tests

This commit is contained in:
Mark McDowall 2013-08-31 21:23:21 -07:00
parent e68fe9033d
commit eeda4e83f9

View File

@ -3,6 +3,7 @@
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Messaging;
using NzbDrone.Common.Messaging.Tracking;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test.EventingTests
@ -27,6 +28,13 @@ public void Setup()
.Setup(c => c.Build(typeof(IExecute<CommandB>)))
.Returns(_executorB.Object);
Mocker.GetMock<ITrackCommands>()
.Setup(c => c.TrackIfNew(It.IsAny<CommandA>()))
.Returns(new TrackedCommand(new CommandA(), CommandState.Running));
Mocker.GetMock<ITrackCommands>()
.Setup(c => c.TrackIfNew(It.IsAny<CommandB>()))
.Returns(new TrackedCommand(new CommandB(), CommandState.Running));
}
[Test]
@ -34,6 +42,10 @@ public void should_publish_command_to_executor()
{
var commandA = new CommandA();
Mocker.GetMock<ITrackCommands>()
.Setup(c => c.TrackIfNew(commandA))
.Returns(new TrackedCommand(commandA, CommandState.Running));
Subject.PublishCommand(commandA);
_executorA.Verify(c => c.Execute(commandA), Times.Once());
@ -55,6 +67,9 @@ public void should_not_publish_to_incompatible_executor()
{
var commandA = new CommandA();
Mocker.GetMock<ITrackCommands>()
.Setup(c => c.TrackIfNew(commandA))
.Returns(new TrackedCommand(commandA, CommandState.Running));
Subject.PublishCommand(commandA);