1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-27 22:57:09 -04:00

Reformat and apply Stylecop rules

This commit is contained in:
ta264
2019-12-22 22:08:53 +00:00
committed by Qstick
parent d4fa9b7345
commit f02fa629cc
1186 changed files with 7105 additions and 5616 deletions
+12 -13
View File
@@ -14,16 +14,15 @@ using NzbDrone.Test.Common.AutoMoq;
namespace NzbDrone.Test.Common
{
public abstract class TestBase<TSubject> : TestBase where TSubject : class
public abstract class TestBase<TSubject> : TestBase
where TSubject : class
{
private TSubject _subject;
[SetUp]
public void CoreTestSetup()
{
_subject = null;
}
protected TSubject Subject
@@ -37,14 +36,11 @@ namespace NzbDrone.Test.Common
return _subject;
}
}
}
public abstract class TestBase : LoggingTest
{
private static readonly Random _random = new Random();
private static int _nextUid;
@@ -65,7 +61,6 @@ namespace NzbDrone.Test.Common
}
}
protected int RandomNumber
{
get
@@ -80,7 +75,10 @@ namespace NzbDrone.Test.Common
get
{
var virtualPath = Path.Combine(TempFolder, "VirtualNzbDrone");
if (!Directory.Exists(virtualPath)) Directory.CreateDirectory(virtualPath);
if (!Directory.Exists(virtualPath))
{
Directory.CreateDirectory(virtualPath);
}
return virtualPath;
}
@@ -120,7 +118,6 @@ namespace NzbDrone.Test.Common
DeleteTempFolder(_tempFolder);
}
public static string GetUID()
{
return Process.GetCurrentProcess().Id + "_" + DateTime.Now.Ticks + "_" + Interlocked.Increment(ref _nextUid);
@@ -133,7 +130,6 @@ namespace NzbDrone.Test.Common
return;
}
try
{
var tempFolder = new DirectoryInfo(folder);
@@ -202,17 +198,20 @@ namespace NzbDrone.Test.Common
return Path.Combine(TempFolder, Path.GetRandomFileName());
}
protected void VerifyEventPublished<TEvent>() where TEvent : class, IEvent
protected void VerifyEventPublished<TEvent>()
where TEvent : class, IEvent
{
VerifyEventPublished<TEvent>(Times.Once());
}
protected void VerifyEventPublished<TEvent>(Times times) where TEvent : class, IEvent
protected void VerifyEventPublished<TEvent>(Times times)
where TEvent : class, IEvent
{
Mocker.GetMock<IEventAggregator>().Verify(c => c.PublishEvent(It.IsAny<TEvent>()), times);
}
protected void VerifyEventNotPublished<TEvent>() where TEvent : class, IEvent
protected void VerifyEventNotPublished<TEvent>()
where TEvent : class, IEvent
{
Mocker.GetMock<IEventAggregator>().Verify(c => c.PublishEvent(It.IsAny<TEvent>()), Times.Never());
}