public void ReadU16_WithDummyData_ReadSuccess() { AgbMemoryMap map = new AgbMemoryMap(); RangedMemoryRegion region = new TestMemoryRegion(); // Write directly to the region region.Write(FIRST_RANGE_START, 0xBB); region.Write(FIRST_RANGE_START + 1, 0xAA); map.RegisterRegion(region); Assert.Equal(0xAABB, map.ReadU16(FIRST_RANGE_START)); }
public void Read_RegisteredTestRegion_ReadRangeSuccess(uint rangeStart) { AgbMemoryMap map = new AgbMemoryMap(); RangedMemoryRegion region = new TestMemoryRegion(); // Write direct to the region instead of through AgbMemoryMap for (uint i = rangeStart; i < rangeStart + TEST_REGION_SIZE; i++) { region.Write(i, (byte)(i & 0xFF)); } map.RegisterRegion(region); for (uint i = rangeStart; i < rangeStart + TEST_REGION_SIZE; i++) { Assert.Equal(i & 0xFF, map.Read(i)); } }