public virtual void TestShouldExtractValidFields() { MpegFrameTest.MpegFrameForTesting mpegFrame = new MpegFrameTest.MpegFrameForTesting (this); Assert.AreEqual(unchecked((int)(0x000007FF)), mpegFrame.ExtractField (unchecked((int)(0xFFE00000)), unchecked((long)(0xFFE00000L)))); Assert.AreEqual(unchecked((int)(0x000007FF)), mpegFrame.ExtractField (unchecked((int)(0xFFEFFFFF)), unchecked((long)(0xFFE00000L)))); Assert.AreEqual(unchecked((int)(0x00000055)), mpegFrame.ExtractField (unchecked((int)(0x11111155)), unchecked((long)(0x000000FFL)))); Assert.AreEqual(unchecked((int)(0x00000055)), mpegFrame.ExtractField (unchecked((int)(0xFFEFFF55)), unchecked((long)(0x000000FFL)))); }
public virtual void TestShouldExtractValidMpegVersion1Header() { byte[] frameData = new byte[] { BYTE_FF, BYTE_FB, BYTE_A2, BYTE_40 }; MpegFrameTest.MpegFrameForTesting mpegFrame = new MpegFrameTest.MpegFrameForTesting(this, frameData); Assert.AreEqual(MpegFrame.MPEG_VERSION_1_0, mpegFrame.GetVersion()); Assert.AreEqual(MpegFrame.MPEG_LAYER_3, mpegFrame.GetLayer()); Assert.AreEqual(160, mpegFrame.GetBitrate()); Assert.AreEqual(44100, mpegFrame.GetSampleRate()); Assert.AreEqual(MpegFrame.CHANNEL_MODE_JOINT_STEREO, mpegFrame.GetChannelMode()); Assert.AreEqual("None", mpegFrame.GetModeExtension()); Assert.AreEqual("None", mpegFrame.GetEmphasis()); Assert.AreEqual(true, mpegFrame.IsProtection()); Assert.AreEqual(true, mpegFrame.HasPadding()); Assert.AreEqual(false, mpegFrame.IsPrivate()); Assert.AreEqual(false, mpegFrame.IsCopyright()); Assert.AreEqual(false, mpegFrame.IsOriginal()); Assert.AreEqual(523, mpegFrame.GetLengthInBytes()); }