Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2895_PushGP_GenealogyAnalysis/HeuristicLab.Tests/Interpreter/Expressions/StringVectorExpressionTests.cs @ 16752

Last change on this file since 16752 was 15771, checked in by bburlacu, 7 years ago

#2895: Add solution skeleton for PushGP with genealogy analysis.

File size: 1.2 KB
Line 
1using System.Collections.Generic;
2using System.Linq;
3using HeuristicLab.Problems.ProgramSynthesis;
4using Microsoft.VisualStudio.TestTools.UnitTesting;
5
6namespace HeuristicLab.Tests.Interpreter.Expressions {
7  [TestClass]
8  public class StringVectorExpressionTests : VectorExpressionTests<string> {
9    protected override string TypeName { get { return "STRING[]"; } }
10
11    protected override IPushStack<IReadOnlyList<string>> Stack { get { return interpreter.StringVectorStack; } }
12    protected override IPushStack<string> LiteralStack { get { return interpreter.StringStack; } }
13
14    protected override IReadOnlyList<string>[] GetValues(int count) {
15      return Enumerable
16        .Range(0, count)
17        .Select(x => GetLiterals(interpreter.Configuration.MaxVectorLength / 2 - 1))
18        .ToArray();
19    }
20
21    protected override IReadOnlyList<string> GetLiterals(int count) {
22      return Enumerable
23        .Range(0, count)
24        .Select(x => interpreter.Configuration.ErcOptions.StringErcOptions.GetErcValue(interpreter.Random))
25        .ToArray();
26    }
27
28    protected override void CheckOtherStacksAreEmpty() {
29      TestStackCounts(stringVectorStack: null);
30    }
31  }
32}
Note: See TracBrowser for help on using the repository browser.