Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/StringVectorExpressionTests.cs @ 15017

Last change on this file since 15017 was 15017, checked in by pkimmesw, 7 years ago

#2665 Fixed Benchmark Problem Definition, Converted LoopExpressions to stateless expressions, Added several unit test to ensure funcionality, Fixed UI bugs

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