public void ExecuteLoadAddressOperation() { m_Bank.Store(5, new MemoryAddress(0)); new OpLoad <int>(new MemoryLocation(new MemoryAddress(0), m_Bank), new MemoryLocation(new MemoryAddress(4), m_Bank)) .Execute(); var t_Value = m_Bank.Load <int>(new MemoryAddress(4)); t_Value.Should().Be(5, "We loaded 5 into memory and copied data into a separate address and loaded from there."); }
public void StoreValueOutOfRangeAddress() { var t_Bank = new MemoryBank(100); Action t_StoreAction = () => t_Bank.Store(10, new MemoryAddress(200)); t_StoreAction.Should().Throw <AddressOutOfRange>(); }
public void ReadInvalidOpCodeFromMemory() { var t_Bank = new MemoryBank(32); t_Bank.Store(255, new MemoryAddress(0)); Action t_Invalid = () => m_Reader.ReadOperationFromMemory(new MemoryAddress(0), t_Bank); t_Invalid.Should().Throw <UnknownOperation>(); }
public void StoreAndLoadValueAtAddress() { var t_Bank = new MemoryBank(100); t_Bank.Store(10, new MemoryAddress(0)); var t_Value = t_Bank.Load <int>(new MemoryAddress(0)); t_Value.Should().Be(10, "We stored the number 10 into the MemoryBank."); }