Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/02/17 21:17:25 (7 years ago)
Author:
pkimmesw
Message:

#2665 Formatted solution using hl dev settings

Location:
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/FloatExpressionTests.cs

    r14834 r14906  
    1 namespace HeuristicLab.Tests.Interpreter.Expressions
    2 {
     1namespace HeuristicLab.Tests.Interpreter.Expressions {
    32  using System;
    43
     
    98
    109  [TestClass]
    11   public class FloatExpressionTests : CommonTests<double>
    12   {
     10  public class FloatExpressionTests : CommonTests<double> {
    1311    private const double delta = 0.00001;
    1412
     
    3331    [TestCategory("ExpressionTest")]
    3432    [TestCategory("FloatExpressionTest")]
    35     public void TestAdd()
    36     {
     33    public void TestAdd() {
    3734      this.interpreter.FloatStack.Push(5.3, 5.3);
    3835      this.interpreter.Run(new FloatAddExpression());
     
    4744    [TestCategory("ExpressionTest")]
    4845    [TestCategory("FloatExpressionTest")]
    49     public void TestAddWithInsufficientArguments()
    50     {
     46    public void TestAddWithInsufficientArguments() {
    5147      this.TestWithInsufficientArguments("+", 1);
    5248    }
     
    5652    [TestCategory("ExpressionTest")]
    5753    [TestCategory("FloatExpressionTest")]
    58     public void TestSubtract()
    59     {
     54    public void TestSubtract() {
    6055      this.interpreter.FloatStack.Push(10.2, 5.3);
    6156      this.interpreter.Run(new FloatSubtractExpression());
     
    7065    [TestCategory("ExpressionTest")]
    7166    [TestCategory("FloatExpressionTest")]
    72     public void TestSubractWithInsufficientArguments()
    73     {
     67    public void TestSubractWithInsufficientArguments() {
    7468      this.TestWithInsufficientArguments("-", 1);
    7569    }
     
    7973    [TestCategory("ExpressionTest")]
    8074    [TestCategory("FloatExpressionTest")]
    81     public void TestMultiply()
    82     {
     75    public void TestMultiply() {
    8376      this.interpreter.FloatStack.Push(9.9, 3.3);
    8477      this.interpreter.Run(new FloatMultiplyExpression());
     
    9386    [TestCategory("ExpressionTest")]
    9487    [TestCategory("FloatExpressionTest")]
    95     public void TestMultiplyWithInsufficientArguments()
    96     {
     88    public void TestMultiplyWithInsufficientArguments() {
    9789      this.TestWithInsufficientArguments("*", 1);
    9890    }
     
    10294    [TestCategory("ExpressionTest")]
    10395    [TestCategory("FloatExpressionTest")]
    104     public void TestDivide()
    105     {
     96    public void TestDivide() {
    10697      this.interpreter.FloatStack.Push(9.9, 3.3);
    10798      this.interpreter.Run(new FloatDivideExpression());
     
    116107    [TestCategory("ExpressionTest")]
    117108    [TestCategory("FloatExpressionTest")]
    118     public void TestDivideWithInsufficientArguments()
    119     {
     109    public void TestDivideWithInsufficientArguments() {
    120110      this.TestWithInsufficientArguments("/", 1);
    121111    }
     
    125115    [TestCategory("ExpressionTest")]
    126116    [TestCategory("FloatExpressionTest")]
    127     public void TestModulo()
    128     {
     117    public void TestModulo() {
    129118      this.interpreter.FloatStack.Push(11.6, 5.3);
    130119      this.interpreter.Run(new FloatModuloExpression());
     
    139128    [TestCategory("ExpressionTest")]
    140129    [TestCategory("FloatExpressionTest")]
    141     public void TestModuloWithInsufficientArguments()
    142     {
     130    public void TestModuloWithInsufficientArguments() {
    143131      this.TestWithInsufficientArguments("%", 1);
    144132    }
     
    148136    [TestCategory("ExpressionTest")]
    149137    [TestCategory("FloatExpressionTest")]
    150     public void TestMin()
    151     {
     138    public void TestMin() {
    152139      this.interpreter.FloatStack.Push(10.2, 5.3);
    153140      this.interpreter.Run(new FloatMinExpression());
     
    162149    [TestCategory("ExpressionTest")]
    163150    [TestCategory("FloatExpressionTest")]
    164     public void TestMinWithInsufficientArguments()
    165     {
     151    public void TestMinWithInsufficientArguments() {
    166152      this.TestWithInsufficientArguments("MIN", 1);
    167153    }
     
    171157    [TestCategory("ExpressionTest")]
    172158    [TestCategory("FloatExpressionTest")]
    173     public void TestMax()
    174     {
     159    public void TestMax() {
    175160      this.interpreter.FloatStack.Push(10.3, 5.3);
    176161      this.interpreter.Run(new FloatMaxExpression());
     
    185170    [TestCategory("ExpressionTest")]
    186171    [TestCategory("FloatExpressionTest")]
    187     public void TestMaxWithInsufficientArguments()
    188     {
     172    public void TestMaxWithInsufficientArguments() {
    189173      this.TestWithInsufficientArguments("MAX", 1);
    190174    }
     
    194178    [TestCategory("ExpressionTest")]
    195179    [TestCategory("FloatExpressionTest")]
    196     public void TestSmallerThan()
    197     {
     180    public void TestSmallerThan() {
    198181      this.interpreter.FloatStack.Push(10.2, 5.3);
    199182      this.interpreter.Run(new FloatSmallerThanExpression());
     
    208191    [TestCategory("ExpressionTest")]
    209192    [TestCategory("FloatExpressionTest")]
    210     public void TestSmallerThanWithInsufficientArguments()
    211     {
     193    public void TestSmallerThanWithInsufficientArguments() {
    212194      this.TestWithInsufficientArguments("<", 1);
    213195    }
     
    217199    [TestCategory("ExpressionTest")]
    218200    [TestCategory("FloatExpressionTest")]
    219     public void TestGreaterThan()
    220     {
     201    public void TestGreaterThan() {
    221202      this.interpreter.FloatStack.Push(10.2, 5.3);
    222203      this.interpreter.Run(new FloatGreaterThanExpression());
     
    231212    [TestCategory("ExpressionTest")]
    232213    [TestCategory("FloatExpressionTest")]
    233     public void TestGreaterThanWithInsufficientArguments()
    234     {
     214    public void TestGreaterThanWithInsufficientArguments() {
    235215      this.TestWithInsufficientArguments(">", 1);
    236216    }
     
    240220    [TestCategory("ExpressionTest")]
    241221    [TestCategory("FloatExpressionTest")]
    242     public void TestFromBooleanTrue()
    243     {
     222    public void TestFromBooleanTrue() {
    244223      this.interpreter.BooleanStack.Push(true);
    245224      this.interpreter.Run(new FloatFromBooleanExpression());
     
    254233    [TestCategory("ExpressionTest")]
    255234    [TestCategory("FloatExpressionTest")]
    256     public void TestFromBooleanFalse()
    257     {
     235    public void TestFromBooleanFalse() {
    258236      this.interpreter.BooleanStack.Push(false);
    259237      this.interpreter.Run(new FloatFromBooleanExpression());
     
    268246    [TestCategory("ExpressionTest")]
    269247    [TestCategory("FloatExpressionTest")]
    270     public void TestFromBooleanWithInsufficientArguments()
    271     {
     248    public void TestFromBooleanWithInsufficientArguments() {
    272249      this.TestWithInsufficientArguments("FROMBOOLEAN");
    273250    }
     
    277254    [TestCategory("ExpressionTest")]
    278255    [TestCategory("FloatExpressionTest")]
    279     public void TestFromInteger()
    280     {
     256    public void TestFromInteger() {
    281257      this.interpreter.IntegerStack.Push(5);
    282258      this.interpreter.Run(new FloatFromIntegerExpression());
     
    291267    [TestCategory("ExpressionTest")]
    292268    [TestCategory("FloatExpressionTest")]
    293     public void TestFromIntegerWithInsufficientArguments()
    294     {
     269    public void TestFromIntegerWithInsufficientArguments() {
    295270      this.TestWithInsufficientArguments("FROMINTEGER");
    296271    }
     
    300275    [TestCategory("ExpressionTest")]
    301276    [TestCategory("FloatExpressionTest")]
    302     public void TestSine()
    303     {
     277    public void TestSine() {
    304278      this.interpreter.FloatStack.Push(Math.PI / 2);
    305279      this.interpreter.Run(new FloatSineExpression());
     
    314288    [TestCategory("ExpressionTest")]
    315289    [TestCategory("FloatExpressionTest")]
    316     public void TestSineWithInsufficientArguments()
    317     {
     290    public void TestSineWithInsufficientArguments() {
    318291      this.TestWithInsufficientArguments("SIN");
    319292    }
     
    323296    [TestCategory("ExpressionTest")]
    324297    [TestCategory("FloatExpressionTest")]
    325     public void TestCosine()
    326     {
     298    public void TestCosine() {
    327299      this.interpreter.FloatStack.Push(Math.PI);
    328300      this.interpreter.Run(new FloatCosineExpression());
     
    337309    [TestCategory("ExpressionTest")]
    338310    [TestCategory("FloatExpressionTest")]
    339     public void TestCosineWithInsufficientArguments()
    340     {
     311    public void TestCosineWithInsufficientArguments() {
    341312      this.TestWithInsufficientArguments("COS");
    342313    }
    343314
    344     protected override double[] GetValues(int count)
    345     {
     315    protected override double[] GetValues(int count) {
    346316      var values = new double[count];
    347317
     
    351321    }
    352322
    353     protected override void CheckOtherStacksAreEmpty()
    354     {
     323    protected override void CheckOtherStacksAreEmpty() {
    355324      this.TestStackCounts(floatStack: null);
    356325    }
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/IntegerExpressionTests.cs

    r14834 r14906  
    1 namespace HeuristicLab.Tests.Interpreter.Expressions
    2 {
     1namespace HeuristicLab.Tests.Interpreter.Expressions {
    32  using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions;
    43  using HeuristicLab.Problems.ProgramSynthesis.Push.Stack;
     
    76
    87  [TestClass]
    9   public class IntegerExpressionTests : CommonTests<long>
    10   {
     8  public class IntegerExpressionTests : CommonTests<long> {
    119    protected override string TypeName
    1210    {
     
    2927    [TestCategory("ExpressionTest")]
    3028    [TestCategory("IntegerExpressionTest")]
    31     public void TestAdd()
    32     {
     29    public void TestAdd() {
    3330      this.interpreter.IntegerStack.Push(5, 5);
    3431      this.interpreter.Run(new IntegerAddExpression());
     
    4340    [TestCategory("ExpressionTest")]
    4441    [TestCategory("IntegerExpressionTest")]
    45     public void TestAddWithInsufficientArguments()
    46     {
     42    public void TestAddWithInsufficientArguments() {
    4743      this.TestWithInsufficientArguments("+", 1);
    4844    }
     
    5248    [TestCategory("ExpressionTest")]
    5349    [TestCategory("IntegerExpressionTest")]
    54     public void TestSubtract()
    55     {
     50    public void TestSubtract() {
    5651      this.interpreter.IntegerStack.Push(10, 5);
    5752      this.interpreter.Run(new IntegerSubtractExpression());
     
    6661    [TestCategory("ExpressionTest")]
    6762    [TestCategory("IntegerExpressionTest")]
    68     public void TestSubtractWithInsufficientArguments()
    69     {
     63    public void TestSubtractWithInsufficientArguments() {
    7064      this.TestWithInsufficientArguments("-", 1);
    7165    }
     
    7569    [TestCategory("ExpressionTest")]
    7670    [TestCategory("IntegerExpressionTest")]
    77     public void TestMultiply()
    78     {
     71    public void TestMultiply() {
    7972      this.interpreter.IntegerStack.Push(10, 5);
    8073      this.interpreter.Run(new IntegerMultiplyExpression());
     
    8982    [TestCategory("ExpressionTest")]
    9083    [TestCategory("IntegerExpressionTest")]
    91     public void TestMultiplyWithInsufficientArguments()
    92     {
     84    public void TestMultiplyWithInsufficientArguments() {
    9385      this.TestWithInsufficientArguments("*", 1);
    9486    }
     
    9890    [TestCategory("ExpressionTest")]
    9991    [TestCategory("IntegerExpressionTest")]
    100     public void TestDivide()
    101     {
     92    public void TestDivide() {
    10293      this.interpreter.IntegerStack.Push(10, 5);
    10394      this.interpreter.Run(new IntegerDivideExpression());
     
    112103    [TestCategory("ExpressionTest")]
    113104    [TestCategory("IntegerExpressionTest")]
    114     public void TestDivideWithInsufficientArguments()
    115     {
     105    public void TestDivideWithInsufficientArguments() {
    116106      this.TestWithInsufficientArguments("/", 1);
    117107    }
     
    121111    [TestCategory("ExpressionTest")]
    122112    [TestCategory("IntegerExpressionTest")]
    123     public void TestModulo()
    124     {
     113    public void TestModulo() {
    125114      this.interpreter.IntegerStack.Push(10, 5);
    126115      this.interpreter.Run(new IntegerModuloExpression());
     
    135124    [TestCategory("ExpressionTest")]
    136125    [TestCategory("IntegerExpressionTest")]
    137     public void TestModuloWithInsufficientArguments()
    138     {
     126    public void TestModuloWithInsufficientArguments() {
    139127      this.TestWithInsufficientArguments("%", 1);
    140128    }
     
    144132    [TestCategory("ExpressionTest")]
    145133    [TestCategory("IntegerExpressionTest")]
    146     public void TestMin()
    147     {
     134    public void TestMin() {
    148135      this.interpreter.IntegerStack.Push(10, 5);
    149136      this.interpreter.Run(new IntegerMinExpression());
     
    158145    [TestCategory("ExpressionTest")]
    159146    [TestCategory("IntegerExpressionTest")]
    160     public void TestMinWithInsufficientArguments()
    161     {
     147    public void TestMinWithInsufficientArguments() {
    162148      this.TestWithInsufficientArguments("MIN", 1);
    163149    }
     
    167153    [TestCategory("ExpressionTest")]
    168154    [TestCategory("IntegerExpressionTest")]
    169     public void TestMax()
    170     {
     155    public void TestMax() {
    171156      this.interpreter.IntegerStack.Push(10, 5);
    172157      this.interpreter.Run(new IntegerMaxExpression());
     
    181166    [TestCategory("ExpressionTest")]
    182167    [TestCategory("IntegerExpressionTest")]
    183     public void TestMaxWithInsufficientArguments()
    184     {
     168    public void TestMaxWithInsufficientArguments() {
    185169      this.TestWithInsufficientArguments("MAX", 1);
    186170    }
     
    190174    [TestCategory("ExpressionTest")]
    191175    [TestCategory("IntegerExpressionTest")]
    192     public void TestSmallerThan()
    193     {
     176    public void TestSmallerThan() {
    194177      this.interpreter.IntegerStack.Push(10, 5);
    195178      this.interpreter.Run(new IntegerSmallerThanExpression());
     
    204187    [TestCategory("ExpressionTest")]
    205188    [TestCategory("IntegerExpressionTest")]
    206     public void TestSmallerThanWithInsufficientArguments()
    207     {
     189    public void TestSmallerThanWithInsufficientArguments() {
    208190      this.TestWithInsufficientArguments("<", 1);
    209191    }
     
    213195    [TestCategory("ExpressionTest")]
    214196    [TestCategory("IntegerExpressionTest")]
    215     public void TestGreaterThan()
    216     {
     197    public void TestGreaterThan() {
    217198      this.interpreter.IntegerStack.Push(10, 5);
    218199      this.interpreter.Run(new IntegerGreaterThanExpression());
     
    227208    [TestCategory("ExpressionTest")]
    228209    [TestCategory("IntegerExpressionTest")]
    229     public void TestGreaterThanWithInsufficientArguments()
    230     {
     210    public void TestGreaterThanWithInsufficientArguments() {
    231211      this.TestWithInsufficientArguments(">", 1);
    232212    }
     
    236216    [TestCategory("ExpressionTest")]
    237217    [TestCategory("IntegerExpressionTest")]
    238     public void TestFromBooleanTrue()
    239     {
     218    public void TestFromBooleanTrue() {
    240219      this.interpreter.BooleanStack.Push(true);
    241220      this.interpreter.Run(new IntegerFromBooleanExpression());
     
    250229    [TestCategory("ExpressionTest")]
    251230    [TestCategory("IntegerExpressionTest")]
    252     public void TestFromBooleanWithInsufficientArguments()
    253     {
     231    public void TestFromBooleanWithInsufficientArguments() {
    254232      this.TestWithInsufficientArguments("FROMBOOLEAN");
    255233    }
     
    259237    [TestCategory("ExpressionTest")]
    260238    [TestCategory("IntegerExpressionTest")]
    261     public void TestFromBooleanFalse()
    262     {
     239    public void TestFromBooleanFalse() {
    263240      this.interpreter.BooleanStack.Push(false);
    264241      this.interpreter.Run(new IntegerFromBooleanExpression());
     
    273250    [TestCategory("ExpressionTest")]
    274251    [TestCategory("IntegerExpressionTest")]
    275     public void TestFromFloat()
    276     {
     252    public void TestFromFloat() {
    277253      this.interpreter.FloatStack.Push(1.5);
    278254      this.interpreter.Run(new IntegerFromFloatExpression());
     
    287263    [TestCategory("ExpressionTest")]
    288264    [TestCategory("IntegerExpressionTest")]
    289     public void TestFromFloatWithInsufficientArguments()
    290     {
     265    public void TestFromFloatWithInsufficientArguments() {
    291266      this.TestWithInsufficientArguments("FROMFLOAT");
    292267    }
    293268
    294     protected override long[] GetValues(int count)
    295     {
     269    protected override long[] GetValues(int count) {
    296270      var values = new long[count];
    297271
     
    301275    }
    302276
    303     protected override void CheckOtherStacksAreEmpty()
    304     {
     277    protected override void CheckOtherStacksAreEmpty() {
    305278      this.TestStackCounts(integerStack: null);
    306279    }
Note: See TracChangeset for help on using the changeset viewer.