1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-27 02:07:41 +00:00

Fixed broken tests after new SceneName method.

This commit is contained in:
Mark McDowall 2011-06-13 22:52:12 -07:00
parent a290a0dcb0
commit e934e71b3b
4 changed files with 16 additions and 2 deletions

View file

@ -247,6 +247,9 @@ namespace NzbDrone.Core.Test
mocker.GetMock<InventoryProvider>()
.Setup(c => c.IsQualityNeeded(It.Is<EpisodeParseResult>(d => d.Series != null && d.Episodes.Count != 0))).Returns(false);
mocker.GetMock<SceneNameMappingProvider>()
.Setup(s => s.GetSceneName(It.IsAny<int>())).Returns("");
//Act
mocker.Resolve<EpisodeSearchJob>().Start(new ProgressNotification("Test"), episode.EpisodeId);
@ -295,6 +298,9 @@ namespace NzbDrone.Core.Test
mocker.GetMock<InventoryProvider>()
.Setup(c => c.IsQualityNeeded(It.Is<EpisodeParseResult>(d => d.Series != null && d.Episodes.Count != 0))).Returns(false);
mocker.GetMock<SceneNameMappingProvider>()
.Setup(s => s.GetSceneName(71256)).Returns("The Daily Show");
//Act
mocker.Resolve<EpisodeSearchJob>().Start(new ProgressNotification("Test"), episode.EpisodeId);
@ -347,7 +353,10 @@ namespace NzbDrone.Core.Test
.Returns(indexers);
mocker.GetMock<InventoryProvider>()
.Setup(c => c.IsQualityNeeded(It.Is<EpisodeParseResult>(d => d.Series != null && d.Episodes.Count != 0))).Returns(false);
.Setup(c => c.IsQualityNeeded(It.Is<EpisodeParseResult>(d => d.Series != null && d.Episodes.Count != 0))).Returns(false);;
mocker.GetMock<SceneNameMappingProvider>()
.Setup(s => s.GetSceneName(It.IsAny<int>())).Returns("");
//Act
mocker.Resolve<EpisodeSearchJob>().Start(new ProgressNotification("Test"), episode.EpisodeId);

View file

@ -46,7 +46,7 @@ namespace NzbDrone.Core
private static readonly Regex NormalizeRegex = new Regex(@"((^|\W)(a|an|the|and|or|of)($|\W))|\W|(?:(?<=[^0-9]+)|\b)(?!(?:19\d{2}|20\d{2}))\d+(?=[^0-9ip]+|\b)",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex SimpleTitleRegex = new Regex(@"480[i|p]|720[i|p]|1080[i|p]|[x|h]264|\\|\/|\<|\>|\?|\*|\:|\|",
private static readonly Regex SimpleTitleRegex = new Regex(@"480[i|p]|720[i|p]|1080[i|p]|[x|h]264|\<|\>|\?|\*|\:|\|",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
/// <summary>

View file

@ -23,6 +23,11 @@ namespace NzbDrone.Core.Providers
_httpProvider = httpProvider;
}
public SceneNameMappingProvider()
{
}
public virtual bool UpdateMappings()
{
try