コード例 #1
0
        public void CreateWhenCalledWithOperandValueCreatesExpectedOperandType(ushort operandValue, Type expectdOperandType)
        {
            var builder = new InstructionOperandFactory();

            var operand = builder.Create(operandValue);

            Assert.That(operand, Is.InstanceOf(expectdOperandType));
        }
コード例 #2
0
        public void CreateWhenCalledWithRegisterAOperandValueBuildsRegisterOperand()
        {
            var builder = new InstructionOperandFactory();

            var operand = builder.Create((ushort)RegisterIdentifier.RegA);

            Assert.That(operand, Is.InstanceOf(typeof(RegisterOperand)));
        }
コード例 #3
0
        public void CreateWhenCalledWithOperandValueSavesOperandValueInOperand(ushort operandValue)
        {
            var builder = new InstructionOperandFactory();

            var operand = builder.Create(operandValue);

            Assert.That(operand.OperandValue, Is.EqualTo(operandValue));
        }