mirror of
https://github.com/lidarr/Lidarr
synced 2025-03-10 22:13:01 +00:00
Fixed spelling for Expected[LogType].
Fixed broken tests for GetEpisodesByParseResult.
This commit is contained in:
parent
77bf257132
commit
69ddeeb0e3
20 changed files with 46 additions and 43 deletions
|
@ -59,7 +59,7 @@ namespace NzbDrone.Common.Test
|
|||
diskProvider.MoveFile(targetPath, targetPath);
|
||||
|
||||
File.Exists(targetPath).Should().BeTrue();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace NzbDrone.Common.Test
|
|||
public void Kill_should_not_fail_on_invalid_process_is(int processId)
|
||||
{
|
||||
_processProvider.Kill(processId);
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -43,7 +43,7 @@ namespace NzbDrone.Common.Test
|
|||
{
|
||||
_processProvider.GetProcessById(1234567).Should().BeNull();
|
||||
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[TestCase(0)]
|
||||
|
@ -53,7 +53,7 @@ namespace NzbDrone.Common.Test
|
|||
{
|
||||
_processProvider.GetProcessById(processId).Should().BeNull();
|
||||
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -105,7 +105,7 @@ namespace NzbDrone.Common.Test
|
|||
serviceProvider.GetService(ALWAYS_INSTALLED_SERVICE).Status
|
||||
.Should().Be(ServiceControllerStatus.Stopped);
|
||||
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace NzbDrone.Core.Test
|
|||
parseResults.Should().OnlyContain(s => s.Indexer == mockIndexer.Name);
|
||||
parseResults.Should().OnlyContain(s => !String.IsNullOrEmpty(s.NzbTitle));
|
||||
|
||||
ExceptionVerification.ExcpectedWarns(warns);
|
||||
ExceptionVerification.ExpectedWarns(warns);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -170,7 +170,7 @@ namespace NzbDrone.Core.Test
|
|||
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(LanguageType.Finnish, result.Language);
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -101,7 +101,7 @@ namespace NzbDrone.Core.Test.JobTests
|
|||
|
||||
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedErrors(2);
|
||||
ExceptionVerification.ExpectedErrors(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -134,7 +134,7 @@ namespace NzbDrone.Core.Test.JobTests
|
|||
|
||||
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, series[0].SeriesId, 0), Times.Once());
|
||||
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ namespace NzbDrone.Core.Test
|
|||
|
||||
Parser.ParseTitle(title).Should().BeNull();
|
||||
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -368,7 +368,7 @@ namespace NzbDrone.Core.Test
|
|||
var result = Parser.ParseTitle(postTitle);
|
||||
|
||||
result.Should().BeNull();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[TestCase("Lie.to.Me.S03.SUBPACK.DVDRip.XviD-REWARD")]
|
||||
|
@ -380,7 +380,7 @@ namespace NzbDrone.Core.Test
|
|||
|
||||
result.Should().BeNull();
|
||||
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[TestCase("Fussball Bundesliga 2010 2011 30 Spieltag FC Bayern Muenchen vs Bayer 04 Leverkusen German WS dTV XviD WoGS")]
|
||||
|
@ -388,7 +388,7 @@ namespace NzbDrone.Core.Test
|
|||
{
|
||||
Parser.ParseTitle(title);
|
||||
ExceptionVerification.IgnoreWarns();
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -137,7 +137,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
|
||||
//Assert
|
||||
VerifySkipImport(result, Mocker);
|
||||
ExceptionVerification.ExcpectedWarns(2);
|
||||
ExceptionVerification.ExpectedWarns(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -251,6 +251,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
|
||||
var fakeSeries = Builder<Series>.CreateNew()
|
||||
.With(s => s.SeriesId = 1)
|
||||
.With(s => s.IsDaily = true)
|
||||
.Build();
|
||||
|
||||
Mocker.GetMock<IDatabase>().Setup(
|
||||
|
@ -279,6 +280,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
|
||||
var fakeSeries = Builder<Series>.CreateNew()
|
||||
.With(s => s.SeriesId = 1)
|
||||
.With(s => s.IsDaily = true)
|
||||
.Build();
|
||||
|
||||
//Act
|
||||
|
@ -303,6 +305,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
|
||||
var fakeSeries = Builder<Series>.CreateNew()
|
||||
.With(s => s.SeriesId = 1)
|
||||
.With(s => s.IsDaily = true)
|
||||
.Build();
|
||||
|
||||
//Act
|
||||
|
@ -406,7 +409,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
var ep = Mocker.Resolve<EpisodeProvider>().GetEpisodesByParseResult(parseResult);
|
||||
|
||||
ep.Should().BeEmpty();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
|
|||
settings.First().LastExecution.Should().BeWithin(TimeSpan.FromSeconds(10));
|
||||
settings.First().Success.Should().BeFalse();
|
||||
brokenJob.ExecutionCount.Should().Be(1);
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -182,7 +182,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
|
|||
|
||||
//Assert
|
||||
brokenJob.ExecutionCount.Should().Be(2);
|
||||
ExceptionVerification.ExcpectedErrors(2);
|
||||
ExceptionVerification.ExpectedErrors(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -487,7 +487,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
|
|||
jobProvider.QueueJob(typeof(string));
|
||||
|
||||
WaitForQueue();
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ namespace NzbDrone.Core.Test.ProviderTests.LogProviderTests
|
|||
logItem.ExceptionType.Should().Be(ex.GetType().ToString());
|
||||
logItem.Exception.Should().Be(ex.ToString());
|
||||
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -125,7 +125,7 @@ namespace NzbDrone.Core.Test.ProviderTests.LogProviderTests
|
|||
|
||||
VerifyLog(logItem, LogLevel.Error);
|
||||
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests
|
|||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -61,7 +61,7 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests
|
|||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -81,7 +81,7 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests
|
|||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -108,7 +108,7 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests
|
|||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -141,7 +141,7 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests
|
|||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[TestCase(@"\_UnknownSeries_The Office - S01E01 - Episode Title")]
|
||||
|
@ -184,7 +184,7 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests
|
|||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
Mocker.GetMock<DiskProvider>().Verify(c => c.MoveDirectory(droppedFolder.FullName, taggedFolder), Times.Once());
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
var result = Mocker.Resolve<ProwlProvider>().Verify(_badApiKey);
|
||||
|
||||
//Assert
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
result.Should().BeFalse();
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
var result = Mocker.Resolve<ProwlProvider>().SendNotification("NzbDrone Test", "This is a test message from NzbDrone", _badApiKey);
|
||||
|
||||
//Assert
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
result.Should().BeFalse();
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
|
||||
//Assert
|
||||
result.Should().HaveCount(0);
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -155,7 +155,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
|
||||
//Assert
|
||||
Assert.IsFalse(result);
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -208,7 +208,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
|
|||
Mocker.GetMock<SceneMappingProvider>().Verify(c => c.GetSceneName(_series.SeriesId),
|
||||
Times.Once());
|
||||
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -275,7 +275,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
|
|||
|
||||
//Assert
|
||||
result.Should().HaveCount(0);
|
||||
ExceptionVerification.ExcpectedErrors(2);
|
||||
ExceptionVerification.ExpectedErrors(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -200,7 +200,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
|
|||
|
||||
//Assert
|
||||
result.Should().BeFalse();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,9 +28,9 @@ namespace NzbDrone.Test.Common
|
|||
|
||||
public static void AssertNoUnexcpectedLogs()
|
||||
{
|
||||
ExcpectedFatals(0);
|
||||
ExcpectedErrors(0);
|
||||
ExcpectedWarns(0);
|
||||
ExpectedFatals(0);
|
||||
ExpectedErrors(0);
|
||||
ExpectedWarns(0);
|
||||
}
|
||||
|
||||
private static string GetLogsString(IEnumerable<LogEventInfo> logs)
|
||||
|
@ -49,17 +49,17 @@ namespace NzbDrone.Test.Common
|
|||
return errors;
|
||||
}
|
||||
|
||||
public static void ExcpectedErrors(int count)
|
||||
public static void ExpectedErrors(int count)
|
||||
{
|
||||
Excpected(LogLevel.Error, count);
|
||||
}
|
||||
|
||||
public static void ExcpectedFatals(int count)
|
||||
public static void ExpectedFatals(int count)
|
||||
{
|
||||
Excpected(LogLevel.Fatal, count);
|
||||
}
|
||||
|
||||
public static void ExcpectedWarns(int count)
|
||||
public static void ExpectedWarns(int count)
|
||||
{
|
||||
Excpected(LogLevel.Warn, count);
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ namespace NzbDrone.Update.Test
|
|||
//Assert
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Verify(c => c.CopyDirectory(BACKUP_FOLDER, TARGET_FOLDER), Times.Once());
|
||||
ExceptionVerification.ExcpectedFatals(1);
|
||||
ExceptionVerification.ExpectedFatals(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -206,7 +206,7 @@ namespace NzbDrone.Update.Test
|
|||
|
||||
//Assert
|
||||
VerifyServiceRestart();
|
||||
ExceptionVerification.ExcpectedFatals(1);
|
||||
ExceptionVerification.ExpectedFatals(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -224,7 +224,7 @@ namespace NzbDrone.Update.Test
|
|||
|
||||
//Assert
|
||||
VerifyProcessRestart();
|
||||
ExceptionVerification.ExcpectedFatals(1);
|
||||
ExceptionVerification.ExpectedFatals(1);
|
||||
}
|
||||
|
||||
private void VerifyServiceRestart()
|
||||
|
|
Loading…
Add table
Reference in a new issue