예제 #1
0
        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);
        }
예제 #2
0
        public void Execute_UnknownLeaType_Throws()
        {
            IntPtr pointer = new IntPtr(0xbeef);
            var op = new LeaOperator(pointer, (LeaType)15);

            op.Execute(null);
        }
예제 #3
0
        public void Execute_NullMemory_Throws()
        {
            IntPtr pointer = new IntPtr(0xbeef);
            var op = new LeaOperator(pointer);

            op.Execute(null);
        }