Exemple #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);
        }
Exemple #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);
        }
Exemple #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();
        }
Exemple #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);
        }