Skip to content

Commit e674c3a

Browse files
committed
Use Length/Count instead of Enumerable.Count where possible
CA1829: Use Length/Count property instead of Enumerable.Count method https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1829
1 parent fa2e0ab commit e674c3a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/TaglibSharp.Tests/FileFormats/Id3V2FormatTest.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public void TestPicturesAreCopied ()
159159
file.Tag.Pictures = new[] { picture };
160160
file.Save ();
161161

162-
Assert.IsTrue (file.Tag.Pictures.Count () == 1, "File should start with 1 picture");
162+
Assert.IsTrue (file.Tag.Pictures.Length == 1, "File should start with 1 picture");
163163

164164
// Now construct a new tag with a title, APIC and GEOB frame
165165

@@ -187,12 +187,12 @@ public void TestPicturesAreCopied ()
187187
tag.CopyTo (file.Tag, false);
188188

189189
Assert.AreEqual ("MP3 title", file.Tag.Title, "Title shouldn't be copied if overwrite=false");
190-
Assert.AreEqual (1, file.Tag.Pictures.Count (), "GEOB/APIC frames shouldn't be copied if overwrite=false");
190+
Assert.AreEqual (1, file.Tag.Pictures.Length, "GEOB/APIC frames shouldn't be copied if overwrite=false");
191191

192192
tag.CopyTo (file.Tag, true);
193193

194194
Assert.AreEqual (tag.Title, file.Tag.Title, "Title wasn't copied");
195-
Assert.AreEqual (tag.Pictures.Count (), file.Tag.Pictures.Count (), "GEOB/APIC frames weren't copied");
195+
Assert.AreEqual (tag.Pictures.Length, file.Tag.Pictures.Length, "GEOB/APIC frames weren't copied");
196196
}
197197
}
198198
}

0 commit comments

Comments
 (0)