public void Execute_SomePointer_Succeeds() { var memMock = new Mock<IMemory>(); IntPtr pointer = new IntPtr(0xbeef); ushort expected = 0xdead; var op = new LeaOperator(pointer, LeaType.Word); memMock.Setup(x => x.Read<ushort>(pointer)).Returns(expected); IntPtr actual = op.Execute(memMock.Object); Assert.AreEqual(expected, (ushort)actual); }
public void Execute_UnknownLeaType_Throws() { IntPtr pointer = new IntPtr(0xbeef); var op = new LeaOperator(pointer, (LeaType)15); op.Execute(null); }
public void Execute_NullMemory_Throws() { IntPtr pointer = new IntPtr(0xbeef); var op = new LeaOperator(pointer); op.Execute(null); }