Ejemplo n.º 1
0
        public void MatchWhenCalledWithUpperCaseXInHexLiteralReturnsTokenPosition()
        {
            var tokenMatcher = new HexToken();

            Assert.That(tokenMatcher.Match("0X10"), Is.EqualTo("0X10"));
        }
Ejemplo n.º 2
0
        public void BuildWhenCalledOnIndirectNextWordOffsetOperandBuilderSetsNextWordValueToTokenContentForHexValue()
        {
            var leftToken = new HexToken { Content = "0xF" };

            var builder = new IndirectNextWordOffsetOperandBuilder(leftToken);

            var rigthToken = new RegisterToken { Content = "A" };

            var operand = builder.Build(rigthToken);

            Assert.That(operand.NextWord, Is.EqualTo(15));
        }
Ejemplo n.º 3
0
        public void BuildWhenCalledOnIndirectNextWordOffsetOperandBuilderSetsRegisterToRightTokenContent()
        {
            var leftToken = new HexToken { Content = "0xF" };

            var builder = new IndirectNextWordOffsetOperandBuilder(leftToken);

            var rigthToken = new RegisterToken { Content = "A" };

            var operand = builder.Build(rigthToken);

            Assert.That(operand.RegisterValue, Is.EqualTo((int)RegisterIdentifier.RegA));
        }
Ejemplo n.º 4
0
        public void BuildWhenCalledOnIndirectNextWordOperandBuilderSetsNextWordValueToTokenContentForHexValue()
        {
            var builder = new IndirectNextWordOperandBuilder();

            var token = new HexToken { Content = "0xF" };

            var operand = builder.Build(token);

            Assert.That(operand.NextWord, Is.EqualTo(15));
        }