post grab notification and updates are now using the new EventAggregator

This commit is contained in:
kay.one 2013-02-24 11:18:48 -08:00
commit 554924a522
40 changed files with 670 additions and 482 deletions

View file

@ -5,6 +5,7 @@ using Moq;
using NLog;
using NUnit.Framework;
using NzbDrone.Common;
using NzbDrone.Common.Eventing;
using NzbDrone.Test.Common.AutoMoq;
namespace NzbDrone.Test.Common
@ -99,5 +100,15 @@ namespace NzbDrone.Test.Common
{
return Path.Combine(Directory.GetCurrentDirectory(), "Files", fileName);
}
protected void VerifyEventPublished<TEvent>(TEvent message) where TEvent : IEvent
{
Mocker.GetMock<IEventAggregator>().Verify(c => c.Publish(message), Times.Once());
}
protected void VerifyEventNotPublished<TEvent>() where TEvent : IEvent
{
Mocker.GetMock<IEventAggregator>().Verify(c => c.Publish(It.IsAny<TEvent>()), Times.Never());
}
}
}