using System.Collections.Generic; using System.Linq; using HeuristicLab.Problems.ProgramSynthesis; namespace HeuristicLab.Tests.Interpreter.Expressions { using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] public class BooleanVectorExpressionsTests : VectorExpressionTests { protected override string TypeName { get { return "BOOLEAN[]"; } } protected override IPushStack> Stack { get { return interpreter.BooleanVectorStack; } } protected override IPushStack LiteralStack { get { return interpreter.BooleanStack; } } protected override IReadOnlyList[] GetValues(int count) { return Enumerable .Range(0, count) .Select(x => GetLiterals(interpreter.Configuration.MaxVectorLength / 2 - 1)) .ToArray(); } protected override IReadOnlyList GetLiterals(int count) { return Enumerable .Range(0, count) .Select(x => interpreter.Configuration.ErcOptions.BooleanErcOptions.GetErcValue(interpreter.Random)) .ToArray(); } protected override void CheckOtherStacksAreEmpty() { TestStackCounts(booleanVectorStack: null); } } }