public void ExecuteLoadConstOperation() { new OpLoadConst <int>(5, new MemoryLocation(new MemoryAddress(0), m_Bank)) .Execute(); var t_Value = m_Bank.Load <int>(new MemoryAddress(0)); t_Value.Should().Be(5, "We loaded the constant value of 5 into memory."); }
public void LoadValueOutOfRangeAddress() { var t_Bank = new MemoryBank(100); Action t_LoadAction = () => t_Bank.Load <int>(new MemoryAddress(200)); t_LoadAction.Should().Throw <AddressOutOfRange>(); }
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."); }