mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Fixed spelling for Expected[LogType].
Fixed broken tests for GetEpisodesByParseResult.
This commit is contained in:
parent
77bf257132
commit
69ddeeb0e3
@ -59,7 +59,7 @@ public void moveFile_should_not_move_overwrite_itself()
|
||||
diskProvider.MoveFile(targetPath, targetPath);
|
||||
|
||||
File.Exists(targetPath).Should().BeTrue();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -35,7 +35,7 @@ public void TearDown()
|
||||
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 @@ public void GetById_should_return_null_if_process_doesnt_exist()
|
||||
{
|
||||
_processProvider.GetProcessById(1234567).Should().BeNull();
|
||||
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[TestCase(0)]
|
||||
@ -53,7 +53,7 @@ public void GetProcessById_should_return_null_for_invalid_process(int processId)
|
||||
{
|
||||
_processProvider.GetProcessById(processId).Should().BeNull();
|
||||
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -105,7 +105,7 @@ public void Should_log_warn_if_on_stop_if_service_is_already_stopped()
|
||||
serviceProvider.GetService(ALWAYS_INSTALLED_SERVICE).Status
|
||||
.Should().Be(ServiceControllerStatus.Stopped);
|
||||
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public void parse_feed_xml(string fileName, int warns)
|
||||
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 @@ public void custome_parser_full_parse(string title)
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(LanguageType.Finnish, result.Language);
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -101,7 +101,7 @@ public void failed_scan_should_not_terminated_job()
|
||||
|
||||
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedErrors(2);
|
||||
ExceptionVerification.ExpectedErrors(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -134,7 +134,7 @@ public void failed_import_should_not_be_stuck_in_loop()
|
||||
|
||||
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, series[0].SeriesId, 0), Times.Once());
|
||||
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,7 @@ public void parse_daily_should_fail_if_episode_is_far_in_future()
|
||||
|
||||
Parser.ParseTitle(title).Should().BeNull();
|
||||
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
|
||||
@ -368,7 +368,7 @@ public void parse_season_extras(string postTitle)
|
||||
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 @@ public void parse_season_subpack(string postTitle)
|
||||
|
||||
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 @@ public void unparsable_should_log_error_but_not_throw(string title)
|
||||
{
|
||||
Parser.ParseTitle(title);
|
||||
ExceptionVerification.IgnoreWarns();
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ public void scan_series_should_log_warning_if_path_doesnt_exist_on_disk()
|
||||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -137,7 +137,7 @@ public void import_unparsable_file_should_skip()
|
||||
|
||||
//Assert
|
||||
VerifySkipImport(result, Mocker);
|
||||
ExceptionVerification.ExcpectedWarns(2);
|
||||
ExceptionVerification.ExpectedWarns(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -251,6 +251,7 @@ public void GetEpisodeParseResult_should_return_single_episode_when_air_date_is_
|
||||
|
||||
var fakeSeries = Builder<Series>.CreateNew()
|
||||
.With(s => s.SeriesId = 1)
|
||||
.With(s => s.IsDaily = true)
|
||||
.Build();
|
||||
|
||||
Mocker.GetMock<IDatabase>().Setup(
|
||||
@ -279,6 +280,7 @@ public void GetEpisodeParseResult_get_daily_should_add_new_episode()
|
||||
|
||||
var fakeSeries = Builder<Series>.CreateNew()
|
||||
.With(s => s.SeriesId = 1)
|
||||
.With(s => s.IsDaily = true)
|
||||
.Build();
|
||||
|
||||
//Act
|
||||
@ -303,6 +305,7 @@ public void GetEpisodeParseResult_get_daily_should_not_add_new_episode_when_auto
|
||||
|
||||
var fakeSeries = Builder<Series>.CreateNew()
|
||||
.With(s => s.SeriesId = 1)
|
||||
.With(s => s.IsDaily = true)
|
||||
.Build();
|
||||
|
||||
//Act
|
||||
@ -406,7 +409,7 @@ public void GetEpisodeParseResult_should_log_warning_when_series_is_not_dailt_bu
|
||||
var ep = Mocker.Resolve<EpisodeProvider>().GetEpisodesByParseResult(parseResult);
|
||||
|
||||
ep.Should().BeEmpty();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ public void failing_scheduled_job_should_mark_job_as_failed()
|
||||
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 @@ public void can_run_broken_job_again()
|
||||
|
||||
//Assert
|
||||
brokenJob.ExecutionCount.Should().Be(2);
|
||||
ExceptionVerification.ExcpectedErrors(2);
|
||||
ExceptionVerification.ExpectedErrors(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -487,7 +487,7 @@ public void trygin_to_queue_unregistered_job_should_fail()
|
||||
jobProvider.QueueJob(typeof(string));
|
||||
|
||||
WaitForQueue();
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public void write_log_exception()
|
||||
logItem.ExceptionType.Should().Be(ex.GetType().ToString());
|
||||
logItem.Exception.Should().Be(ex.ToString());
|
||||
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -125,7 +125,7 @@ public void exception_log_with_no_message_should_use_exceptions_message()
|
||||
|
||||
VerifyLog(logItem, LogLevel.Error);
|
||||
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -45,7 +45,7 @@ public void should_continue_processing_if_folder_is_tagged_and_not_fresh()
|
||||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ public void should_search_for_series_using_title_without_status()
|
||||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -81,7 +81,7 @@ public void when_series_isnt_found_folder_should_be_tagged_as_unknown_series()
|
||||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -108,7 +108,7 @@ public void when_no_files_are_imported_folder_should_be_tagged_with_parse_error(
|
||||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
|
||||
@ -141,7 +141,7 @@ public void when_no_file_are_imported_and_folder_size_isnt_small_enought_folder_
|
||||
|
||||
//Assert
|
||||
Mocker.VerifyAllMocks();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[TestCase(@"\_UnknownSeries_The Office - S01E01 - Episode Title")]
|
||||
@ -184,7 +184,7 @@ public void folder_should_be_tagged_if_existing_tag_is_diffrent()
|
||||
//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 @@ public void Verify_should_return_false_for_an_invalid_apiKey()
|
||||
var result = Mocker.Resolve<ProwlProvider>().Verify(_badApiKey);
|
||||
|
||||
//Assert
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
result.Should().BeFalse();
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ public void SendNotification_should_return_false_for_an_invalid_apiKey()
|
||||
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 @@ public void GetDailySeriesIds_should_return_empty_list_of_int_when_server_is_una
|
||||
|
||||
//Assert
|
||||
result.Should().HaveCount(0);
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -155,7 +155,7 @@ public void AddByUrlError()
|
||||
|
||||
//Assert
|
||||
Assert.IsFalse(result);
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -208,7 +208,7 @@ public void broken_indexer_should_not_block_other_indexers()
|
||||
Mocker.GetMock<SceneMappingProvider>().Verify(c => c.GetSceneName(_series.SeriesId),
|
||||
Times.Once());
|
||||
|
||||
ExceptionVerification.ExcpectedErrors(1);
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -275,7 +275,7 @@ public void PerformSearch_should_return_empty_list_when_results_from_indexers_ar
|
||||
|
||||
//Assert
|
||||
result.Should().HaveCount(0);
|
||||
ExceptionVerification.ExcpectedErrors(2);
|
||||
ExceptionVerification.ExpectedErrors(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -200,7 +200,7 @@ public void EpisodeSearch_should_skip_if_air_date_is_null()
|
||||
|
||||
//Assert
|
||||
result.Should().BeFalse();
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,9 +28,9 @@ public static void Reset()
|
||||
|
||||
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 @@ private static string GetLogsString(IEnumerable<LogEventInfo> logs)
|
||||
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 @@ public void should_restore_if_update_fails()
|
||||
//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 @@ public void should_restart_service_if_service_was_running_and_update_fails()
|
||||
|
||||
//Assert
|
||||
VerifyServiceRestart();
|
||||
ExceptionVerification.ExcpectedFatals(1);
|
||||
ExceptionVerification.ExpectedFatals(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -224,7 +224,7 @@ public void should_restart_process_if_service_was_not_running_and_update_fails()
|
||||
|
||||
//Assert
|
||||
VerifyProcessRestart();
|
||||
ExceptionVerification.ExcpectedFatals(1);
|
||||
ExceptionVerification.ExpectedFatals(1);
|
||||
}
|
||||
|
||||
private void VerifyServiceRestart()
|
||||
|
Loading…
Reference in New Issue
Block a user