public void CompareBytesAtReturnsTrueWhenBytesMatch()
 {
     string testData = "Some test data for this unit test";
     string match = "unit test";
     BigEndianBinaryAccessor accessor = new BigEndianBinaryAccessor(Encoding.ASCII.GetBytes(testData));
     Assert.IsTrue(accessor.CompareBytesAt(0x18, Encoding.ASCII.GetBytes(match)));
 }
 public void CompareBytesThrowsArgumentExceptionIfInvalidOffsetGiven()
 {
     string testData = "Some test data for this unit test";
     BigEndianBinaryAccessor accessor = new BigEndianBinaryAccessor(Encoding.ASCII.GetBytes(testData));
     Assert.IsFalse(accessor.CompareBytesAt(0xFFFF, Encoding.ASCII.GetBytes("test")));
 }
Exemple #3
0
 public bool IsValidROM(BigEndianBinaryAccessor accessor)
 {
     return (accessor.CompareBytesAt(0x100, Encoding.ASCII.GetBytes("SEGA GENESIS"))
         || accessor.CompareBytesAt(0x100, Encoding.ASCII.GetBytes("SEGA MEGADRIVE")));
 }