public void ProcessExtractsLiteralFromOperandValue() { var cpuStateManager = new Mock<ICpuStateOperations>(); var operand = new LiteralOperand { OperandValue = 0x0 }; operand.Process(cpuStateManager.Object); var literal = operand.Read(cpuStateManager.Object); Assert.That(literal, Is.EqualTo(0x0)); }
public void ToStringReturnsOperandStringRepresentation() { var cpuStateManager = new Mock<ICpuStateOperations>(); var operand = new LiteralOperand { OperandValue = 0x0 }; operand.Process(cpuStateManager.Object); var expected = string.Format("0x{0:X4}", 0x0); Assert.That(operand.ToString(), Is.EqualTo(expected)); }
public void AssembleThrowsInvalidOperationExceptionForSecondOperand() { var operand = new LiteralOperand { OperandValue = 0x10 }; Assert.Throws<InvalidOperationException>(() => operand.AssembleOperand(1)); }