From eeda4e83f9de2eef76ea97560dbc921e54c290af Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 31 Aug 2013 21:23:21 -0700 Subject: [PATCH] Fixed the broken tests --- .../MessageAggregatorCommandTests.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/NzbDrone.Common.Test/EventingTests/MessageAggregatorCommandTests.cs b/NzbDrone.Common.Test/EventingTests/MessageAggregatorCommandTests.cs index a0534a1ba..35d7d03d1 100644 --- a/NzbDrone.Common.Test/EventingTests/MessageAggregatorCommandTests.cs +++ b/NzbDrone.Common.Test/EventingTests/MessageAggregatorCommandTests.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; 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 @@ namespace NzbDrone.Common.Test.EventingTests .Setup(c => c.Build(typeof(IExecute))) .Returns(_executorB.Object); + Mocker.GetMock() + .Setup(c => c.TrackIfNew(It.IsAny())) + .Returns(new TrackedCommand(new CommandA(), CommandState.Running)); + + Mocker.GetMock() + .Setup(c => c.TrackIfNew(It.IsAny())) + .Returns(new TrackedCommand(new CommandB(), CommandState.Running)); } [Test] @@ -34,6 +42,10 @@ namespace NzbDrone.Common.Test.EventingTests { var commandA = new CommandA(); + Mocker.GetMock() + .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 @@ namespace NzbDrone.Common.Test.EventingTests { var commandA = new CommandA(); + Mocker.GetMock() + .Setup(c => c.TrackIfNew(commandA)) + .Returns(new TrackedCommand(commandA, CommandState.Running)); Subject.PublishCommand(commandA);