namespace HeuristicLab.Tests.Interpreter { using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration; using HeuristicLab.Problems.ProgramSynthesis.Push.Interpreter; using Microsoft.VisualStudio.TestTools.UnitTesting; public class ExpressionTest { protected PushInterpreter interpreter; protected PushConfiguration configuration = new PushConfiguration { TopLevelPushCode = false }; [TestInitialize] public void BeforeTest() { interpreter = new PushInterpreter(configuration); } protected void TestStackCounts( int? execStack = 0, int? codeStack = 0, int? nameStack = 0, int? booleanStack = 0, int? floatStack = 0, int? integerStack = 0) { if (execStack.HasValue) Assert.AreEqual(execStack, interpreter.ExecStack.Count); if (codeStack.HasValue) Assert.AreEqual(codeStack, interpreter.CodeStack.Count); if (nameStack.HasValue) Assert.AreEqual(nameStack, interpreter.NameStack.Count); if (booleanStack.HasValue) Assert.AreEqual(booleanStack, interpreter.BooleanStack.Count); if (floatStack.HasValue) Assert.AreEqual(floatStack, interpreter.FloatStack.Count); if (integerStack.HasValue) Assert.AreEqual(integerStack, interpreter.IntegerStack.Count); } } }