Changeset 14906 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/IntegerExpressionTests.cs
- Timestamp:
- 05/02/17 21:17:25 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/IntegerExpressionTests.cs
r14834 r14906 1 namespace HeuristicLab.Tests.Interpreter.Expressions 2 { 1 namespace HeuristicLab.Tests.Interpreter.Expressions { 3 2 using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions; 4 3 using HeuristicLab.Problems.ProgramSynthesis.Push.Stack; … … 7 6 8 7 [TestClass] 9 public class IntegerExpressionTests : CommonTests<long> 10 { 8 public class IntegerExpressionTests : CommonTests<long> { 11 9 protected override string TypeName 12 10 { … … 29 27 [TestCategory("ExpressionTest")] 30 28 [TestCategory("IntegerExpressionTest")] 31 public void TestAdd() 32 { 29 public void TestAdd() { 33 30 this.interpreter.IntegerStack.Push(5, 5); 34 31 this.interpreter.Run(new IntegerAddExpression()); … … 43 40 [TestCategory("ExpressionTest")] 44 41 [TestCategory("IntegerExpressionTest")] 45 public void TestAddWithInsufficientArguments() 46 { 42 public void TestAddWithInsufficientArguments() { 47 43 this.TestWithInsufficientArguments("+", 1); 48 44 } … … 52 48 [TestCategory("ExpressionTest")] 53 49 [TestCategory("IntegerExpressionTest")] 54 public void TestSubtract() 55 { 50 public void TestSubtract() { 56 51 this.interpreter.IntegerStack.Push(10, 5); 57 52 this.interpreter.Run(new IntegerSubtractExpression()); … … 66 61 [TestCategory("ExpressionTest")] 67 62 [TestCategory("IntegerExpressionTest")] 68 public void TestSubtractWithInsufficientArguments() 69 { 63 public void TestSubtractWithInsufficientArguments() { 70 64 this.TestWithInsufficientArguments("-", 1); 71 65 } … … 75 69 [TestCategory("ExpressionTest")] 76 70 [TestCategory("IntegerExpressionTest")] 77 public void TestMultiply() 78 { 71 public void TestMultiply() { 79 72 this.interpreter.IntegerStack.Push(10, 5); 80 73 this.interpreter.Run(new IntegerMultiplyExpression()); … … 89 82 [TestCategory("ExpressionTest")] 90 83 [TestCategory("IntegerExpressionTest")] 91 public void TestMultiplyWithInsufficientArguments() 92 { 84 public void TestMultiplyWithInsufficientArguments() { 93 85 this.TestWithInsufficientArguments("*", 1); 94 86 } … … 98 90 [TestCategory("ExpressionTest")] 99 91 [TestCategory("IntegerExpressionTest")] 100 public void TestDivide() 101 { 92 public void TestDivide() { 102 93 this.interpreter.IntegerStack.Push(10, 5); 103 94 this.interpreter.Run(new IntegerDivideExpression()); … … 112 103 [TestCategory("ExpressionTest")] 113 104 [TestCategory("IntegerExpressionTest")] 114 public void TestDivideWithInsufficientArguments() 115 { 105 public void TestDivideWithInsufficientArguments() { 116 106 this.TestWithInsufficientArguments("/", 1); 117 107 } … … 121 111 [TestCategory("ExpressionTest")] 122 112 [TestCategory("IntegerExpressionTest")] 123 public void TestModulo() 124 { 113 public void TestModulo() { 125 114 this.interpreter.IntegerStack.Push(10, 5); 126 115 this.interpreter.Run(new IntegerModuloExpression()); … … 135 124 [TestCategory("ExpressionTest")] 136 125 [TestCategory("IntegerExpressionTest")] 137 public void TestModuloWithInsufficientArguments() 138 { 126 public void TestModuloWithInsufficientArguments() { 139 127 this.TestWithInsufficientArguments("%", 1); 140 128 } … … 144 132 [TestCategory("ExpressionTest")] 145 133 [TestCategory("IntegerExpressionTest")] 146 public void TestMin() 147 { 134 public void TestMin() { 148 135 this.interpreter.IntegerStack.Push(10, 5); 149 136 this.interpreter.Run(new IntegerMinExpression()); … … 158 145 [TestCategory("ExpressionTest")] 159 146 [TestCategory("IntegerExpressionTest")] 160 public void TestMinWithInsufficientArguments() 161 { 147 public void TestMinWithInsufficientArguments() { 162 148 this.TestWithInsufficientArguments("MIN", 1); 163 149 } … … 167 153 [TestCategory("ExpressionTest")] 168 154 [TestCategory("IntegerExpressionTest")] 169 public void TestMax() 170 { 155 public void TestMax() { 171 156 this.interpreter.IntegerStack.Push(10, 5); 172 157 this.interpreter.Run(new IntegerMaxExpression()); … … 181 166 [TestCategory("ExpressionTest")] 182 167 [TestCategory("IntegerExpressionTest")] 183 public void TestMaxWithInsufficientArguments() 184 { 168 public void TestMaxWithInsufficientArguments() { 185 169 this.TestWithInsufficientArguments("MAX", 1); 186 170 } … … 190 174 [TestCategory("ExpressionTest")] 191 175 [TestCategory("IntegerExpressionTest")] 192 public void TestSmallerThan() 193 { 176 public void TestSmallerThan() { 194 177 this.interpreter.IntegerStack.Push(10, 5); 195 178 this.interpreter.Run(new IntegerSmallerThanExpression()); … … 204 187 [TestCategory("ExpressionTest")] 205 188 [TestCategory("IntegerExpressionTest")] 206 public void TestSmallerThanWithInsufficientArguments() 207 { 189 public void TestSmallerThanWithInsufficientArguments() { 208 190 this.TestWithInsufficientArguments("<", 1); 209 191 } … … 213 195 [TestCategory("ExpressionTest")] 214 196 [TestCategory("IntegerExpressionTest")] 215 public void TestGreaterThan() 216 { 197 public void TestGreaterThan() { 217 198 this.interpreter.IntegerStack.Push(10, 5); 218 199 this.interpreter.Run(new IntegerGreaterThanExpression()); … … 227 208 [TestCategory("ExpressionTest")] 228 209 [TestCategory("IntegerExpressionTest")] 229 public void TestGreaterThanWithInsufficientArguments() 230 { 210 public void TestGreaterThanWithInsufficientArguments() { 231 211 this.TestWithInsufficientArguments(">", 1); 232 212 } … … 236 216 [TestCategory("ExpressionTest")] 237 217 [TestCategory("IntegerExpressionTest")] 238 public void TestFromBooleanTrue() 239 { 218 public void TestFromBooleanTrue() { 240 219 this.interpreter.BooleanStack.Push(true); 241 220 this.interpreter.Run(new IntegerFromBooleanExpression()); … … 250 229 [TestCategory("ExpressionTest")] 251 230 [TestCategory("IntegerExpressionTest")] 252 public void TestFromBooleanWithInsufficientArguments() 253 { 231 public void TestFromBooleanWithInsufficientArguments() { 254 232 this.TestWithInsufficientArguments("FROMBOOLEAN"); 255 233 } … … 259 237 [TestCategory("ExpressionTest")] 260 238 [TestCategory("IntegerExpressionTest")] 261 public void TestFromBooleanFalse() 262 { 239 public void TestFromBooleanFalse() { 263 240 this.interpreter.BooleanStack.Push(false); 264 241 this.interpreter.Run(new IntegerFromBooleanExpression()); … … 273 250 [TestCategory("ExpressionTest")] 274 251 [TestCategory("IntegerExpressionTest")] 275 public void TestFromFloat() 276 { 252 public void TestFromFloat() { 277 253 this.interpreter.FloatStack.Push(1.5); 278 254 this.interpreter.Run(new IntegerFromFloatExpression()); … … 287 263 [TestCategory("ExpressionTest")] 288 264 [TestCategory("IntegerExpressionTest")] 289 public void TestFromFloatWithInsufficientArguments() 290 { 265 public void TestFromFloatWithInsufficientArguments() { 291 266 this.TestWithInsufficientArguments("FROMFLOAT"); 292 267 } 293 268 294 protected override long[] GetValues(int count) 295 { 269 protected override long[] GetValues(int count) { 296 270 var values = new long[count]; 297 271 … … 301 275 } 302 276 303 protected override void CheckOtherStacksAreEmpty() 304 { 277 protected override void CheckOtherStacksAreEmpty() { 305 278 this.TestStackCounts(integerStack: null); 306 279 }
Note: See TracChangeset
for help on using the changeset viewer.