Exemplo n.º 1
0
        public void Poke_modifies_top_value()
        {
            var uut = new ThreadStack();

            uut.Poke(Variable.One);
            var result = uut.Peek();

            result.Should().Be(Variable.One);
        }
Exemplo n.º 2
0
        public void Peek_with_param_returns_the_item_offset_from_StackPointer()
        {
            var uut = new ThreadStack();

            uut.Push(Variable.One);
            uut.Push(2);
            var result = uut.Peek(-2);

            result.Should().Be(Variable.One);
        }
Exemplo n.º 3
0
        public void Peek_returns_the_top_item()
        {
            var uut = new ThreadStack();

            uut.Push(Variable.One);
            uut.Push(2);
            var result = uut.Peek();

            result.Should().BeNull();
        }
Exemplo n.º 4
0
        public void Poke_with_param_modifies_the_item_offset_from_StackPointer()
        {
            var uut = new ThreadStack();

            uut.Push(Variable.One);
            uut.Push(2);
            uut.Poke(-2, 15);
            var result = uut.Peek(-2);

            result.GetInteger().Should().Be(15);
        }