using System;
using System.Collections.Generic;
using System.Text;
using UnitTestSharp;
using DNAModule.Sunweaver.Commands.Abstracts;

namespace DNAModule.Sunweaver.UnitTests.Commands.Abstracts
{
    
    public class UnaryBooleanOperationTests : TestFixture
    {
        class UnaryOperationTester : DNAModule.Sunweaver.Commands.Abstracts.UnaryBooleanLogic
        {
            public bool A = false;
            public override void Operation(bool a)
            {
                A = a;
            }
        }

        
        public override void TestSetup()
        {
            VM = new DNAModule.Sunweaver.DataPrototypes.VirtualMachine();
        }

        UnaryOperationTester bp = new UnaryOperationTester();
        DNAModule.Sunweaver.DataPrototypes.VirtualMachine VM;

        
        public void DecreasesStackDepthBy1()
        {
            
            VM.BoolStack.Push(false);

            bp.Implementation(VM);

            CheckEqual(0, VM.Stack.Count());
        }

        
        public void FizzlesWhenEmpty()
        {
            
            bp.A = false;

            bp.Implementation(VM);

            CheckEqual((long)0, VM.BoolStack.Count());
            CheckFalse( bp.A);
        }

        
        public void PullsStackValuesCorrectly()
        {
            
            VM.BoolStack.Push(false);

            bp.Implementation(VM);

            CheckFalse( bp.A);
        }
    }
}