Skip to content

Commit

Permalink
Use Length/Count instead of Enumerable.Count where possible
Browse files Browse the repository at this point in the history
CA1829: Use Length/Count property instead of Enumerable.Count method
https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1829
  • Loading branch information
decriptor committed Jul 30, 2022
1 parent fa2e0ab commit e674c3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/TaglibSharp.Tests/FileFormats/Id3V2FormatTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void TestPicturesAreCopied ()
file.Tag.Pictures = new[] { picture };
file.Save ();

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

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

Expand Down Expand Up @@ -187,12 +187,12 @@ public void TestPicturesAreCopied ()
tag.CopyTo (file.Tag, false);

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

tag.CopyTo (file.Tag, true);

Assert.AreEqual (tag.Title, file.Tag.Title, "Title wasn't copied");
Assert.AreEqual (tag.Pictures.Count (), file.Tag.Pictures.Count (), "GEOB/APIC frames weren't copied");
Assert.AreEqual (tag.Pictures.Length, file.Tag.Pictures.Length, "GEOB/APIC frames weren't copied");
}
}
}

0 comments on commit e674c3a

Please sign in to comment.