mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-22 22:16:13 -04:00
Use Length/Count property instead of Count() method to prevent enumerating
This commit is contained in:
@@ -71,7 +71,7 @@ namespace NzbDrone.Core.Test.Extras.Others
|
||||
|
||||
var results = Subject.ImportFiles(_localEpisode, _episodeFile, files, true).ToList();
|
||||
|
||||
results.Count().Should().Be(1);
|
||||
results.Count.Should().Be(1);
|
||||
|
||||
results[0].RelativePath.AsOsAgnostic().PathEquals(Path.Combine("Season 1", expectedOutputPath).AsOsAgnostic()).Should().Be(true);
|
||||
}
|
||||
@@ -87,7 +87,7 @@ namespace NzbDrone.Core.Test.Extras.Others
|
||||
|
||||
var results = Subject.ImportFiles(_localEpisode, _episodeFile, files, true).ToList();
|
||||
|
||||
results.Count().Should().Be(1);
|
||||
results.Count.Should().Be(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace NzbDrone.Core.Test.Extras.Subtitles
|
||||
|
||||
var results = Subject.ImportFiles(_localEpisode, _episodeFile, files, true).ToList();
|
||||
|
||||
results.Count().Should().Be(0);
|
||||
results.Count.Should().Be(0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -92,7 +92,7 @@ namespace NzbDrone.Core.Test.Extras.Subtitles
|
||||
|
||||
var results = Subject.ImportFiles(_localEpisode, _episodeFile, files, true).ToList();
|
||||
|
||||
results.Count().Should().Be(1);
|
||||
results.Count.Should().Be(1);
|
||||
|
||||
results[0].RelativePath.AsOsAgnostic().PathEquals(Path.Combine("Season 1", expectedOutputPath).AsOsAgnostic()).Should().Be(true);
|
||||
}
|
||||
@@ -118,7 +118,7 @@ namespace NzbDrone.Core.Test.Extras.Subtitles
|
||||
|
||||
var results = Subject.ImportFiles(_localEpisode, _episodeFile, files, true).ToList();
|
||||
|
||||
results.Count().Should().Be(expectedOutputs.Length);
|
||||
results.Count.Should().Be(expectedOutputs.Length);
|
||||
|
||||
for (int i = 0; i < expectedOutputs.Length; i++)
|
||||
{
|
||||
@@ -147,7 +147,7 @@ namespace NzbDrone.Core.Test.Extras.Subtitles
|
||||
|
||||
var results = Subject.ImportFiles(_localEpisode, _episodeFile, files, true).ToList();
|
||||
|
||||
results.Count().Should().Be(expectedOutputs.Length);
|
||||
results.Count.Should().Be(expectedOutputs.Length);
|
||||
|
||||
for (int i = 0; i < expectedOutputs.Length; i++)
|
||||
{
|
||||
@@ -178,7 +178,7 @@ namespace NzbDrone.Core.Test.Extras.Subtitles
|
||||
|
||||
var results = Subject.ImportFiles(_localEpisode, _episodeFile, new List<string> { subtitleFile }, true).ToList();
|
||||
|
||||
results.Count().Should().Be(1);
|
||||
results.Count.Should().Be(1);
|
||||
|
||||
results[0].RelativePath.AsOsAgnostic().PathEquals(Path.Combine("Season 1", expectedOutputPath).AsOsAgnostic()).Should().Be(true);
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace NzbDrone.Core.Test.Extras.Subtitles
|
||||
|
||||
var results = Subject.ImportFiles(_localEpisode, _episodeFile, new List<string> { subtitleFile }, true).ToList();
|
||||
|
||||
results.Count().Should().Be(0);
|
||||
results.Count.Should().Be(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user