public void ConvertTest1()
        {
            var playCounterFrame = new PlayCounterFrame();
            Assert.AreEqual(playCounterFrame.Descriptor.Id, "PCNT");
            Assert.AreEqual(playCounterFrame.Counter, 0);

            RawFrame rawFrame = playCounterFrame.Convert(TagVersion.Id3V23);
            Assert.AreEqual(rawFrame.Id, "PCNT");

            ReadOnlyCollection<byte> payloadBytes = rawFrame.Payload;
            var refBytes = new byte[] {0x00, 0x00, 0x00, 0x00};

            Assert.IsTrue(ComparePayload(refBytes, payloadBytes));
        }
        public void ConvertTest4()
        {
            const long counterValue = 0x01FFFF;

            var playCounterFrame = new PlayCounterFrame(counterValue);
            Assert.AreEqual(playCounterFrame.Descriptor.Id, "PCNT");
            Assert.AreEqual(playCounterFrame.Counter, counterValue);

            RawFrame rawFrame = playCounterFrame.Convert(TagVersion.Id3V23);
            Assert.AreEqual(rawFrame.Id, "PCNT");

            ReadOnlyCollection<byte> payloadBytes = rawFrame.Payload;
            var refBytes = new byte[] {0x00, 0x01, 0xFF, 0xFF};

            Assert.IsTrue(ComparePayload(refBytes, payloadBytes));
        }
Example #3
0
        public void SynchronizedTest5()
        {
            var tagContainer1 = new TagContainerV3();
            tagContainer1.Tag.SetHeaderOptions(true, false, false);

            const long counter = 0x12FF;
            var playCounter = new PlayCounterFrame(counter);
            tagContainer1.Add(playCounter);

            TagContainer tagContainer2 = WriteAndRead(tagContainer1);
            CompareContainer(tagContainer1, tagContainer2);

            PlayCounterFrame playCounter2 = FrameUtilities.ConvertToPlayCounterFrame(tagContainer2[0]);
            Assert.AreEqual(playCounter2.Counter, counter);
        }