public void MatchSegment_ValidHeaderAndType() { var segment = new JpegSegment(JpegSegmentType.App1, new byte[] { (byte)'T', (byte)'e', (byte)'s', (byte)'t', 0x00, 0x12, 0x34 }, 0); Assert.IsTrue(JpegSegmentUtils.MatchSegment(segment, JpegSegmentType.App1, "Test\0")); }
private static bool IsAttributeSegment(JpegSegment segment) { const string header = AttributeReader.JpegSegmentHeader; return(JpegSegmentUtils.MatchSegment(segment, JpegSegmentType.App1, header)); }
public void MatchSegment_ShortHeader() { var segment = new JpegSegment(JpegSegmentType.App1, new byte[0], 0); Assert.IsFalse(JpegSegmentUtils.MatchSegment(segment, JpegSegmentType.App1, "Test\0")); }
public void MatchSegment_InvalidType() { var segment = new JpegSegment(JpegSegmentType.App0, new byte[0], 0); Assert.IsFalse(JpegSegmentUtils.MatchSegment(segment, JpegSegmentType.App1, "Test\0")); }