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 PushGpInterpreter interpreter; protected PushGpConfiguration configuration = new PushGpConfiguration { TopLevelPushCode = false }; [TestInitialize] public void BeforeTest() { this.interpreter = new PushGpInterpreter(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, this.interpreter.ExecStack.Count); if (codeStack.HasValue) Assert.AreEqual(codeStack, this.interpreter.CodeStack.Count); if (nameStack.HasValue) Assert.AreEqual(nameStack, this.interpreter.NameStack.Count); if (booleanStack.HasValue) Assert.AreEqual(booleanStack, this.interpreter.BooleanStack.Count); if (floatStack.HasValue) Assert.AreEqual(floatStack, this.interpreter.FloatStack.Count); if (integerStack.HasValue) Assert.AreEqual(integerStack, this.interpreter.IntegerStack.Count); } } }