Changeset 14908 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/BooleanExpressionTests.cs
- Timestamp:
- 05/02/17 22:03:01 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Interpreter/Expressions/BooleanExpressionTests.cs
r14834 r14908 19 19 get 20 20 { 21 return this.interpreter.BooleanStack;21 return interpreter.BooleanStack; 22 22 } 23 23 } … … 28 28 [TestCategory("BooleanExpressionTest")] 29 29 public void TestAnd() { 30 this.interpreter.BooleanStack.Push(true, false);31 this.interpreter.Run(new BooleanAndExpression());30 interpreter.BooleanStack.Push(true, false); 31 interpreter.Run(new BooleanAndExpression()); 32 32 33 Assert.AreEqual(false, this.interpreter.BooleanStack.Top);33 Assert.AreEqual(false, interpreter.BooleanStack.Top); 34 34 35 this.TestStackCounts(booleanStack: 1);35 TestStackCounts(booleanStack: 1); 36 36 } 37 37 … … 41 41 [TestCategory("BooleanExpressionTest")] 42 42 public void TestAndWithInsufficientArguments() { 43 this.TestWithInsufficientArguments("AND", 1);43 TestWithInsufficientArguments("AND", 1); 44 44 } 45 45 … … 49 49 [TestCategory("BooleanExpressionTest")] 50 50 public void TestOr() { 51 this.interpreter.BooleanStack.Push(true, false);52 this.interpreter.Run(new BooleanOrExpression());51 interpreter.BooleanStack.Push(true, false); 52 interpreter.Run(new BooleanOrExpression()); 53 53 54 Assert.AreEqual(true, this.interpreter.BooleanStack.Top);54 Assert.AreEqual(true, interpreter.BooleanStack.Top); 55 55 56 this.TestStackCounts(booleanStack: 1);56 TestStackCounts(booleanStack: 1); 57 57 } 58 58 … … 62 62 [TestCategory("BooleanExpressionTest")] 63 63 public void TestOrWithInsufficientArguments() { 64 this.TestWithInsufficientArguments("OR", 1);64 TestWithInsufficientArguments("OR", 1); 65 65 } 66 66 … … 70 70 [TestCategory("BooleanExpressionTest")] 71 71 public void TestNot() { 72 this.interpreter.BooleanStack.Push(true);73 this.interpreter.Run(new BooleanNotExpression());72 interpreter.BooleanStack.Push(true); 73 interpreter.Run(new BooleanNotExpression()); 74 74 75 Assert.AreEqual(false, this.interpreter.BooleanStack.Top);75 Assert.AreEqual(false, interpreter.BooleanStack.Top); 76 76 77 this.TestStackCounts(booleanStack: 1);77 TestStackCounts(booleanStack: 1); 78 78 } 79 79 … … 83 83 [TestCategory("BooleanExpressionTest")] 84 84 public void TestNotWithInsufficientArguments() { 85 this.TestWithInsufficientArguments("NOT");85 TestWithInsufficientArguments("NOT"); 86 86 } 87 87 … … 91 91 [TestCategory("BooleanExpressionTest")] 92 92 public void TestFromFloat() { 93 this.interpreter.FloatStack.Push(2.0);94 this.interpreter.Run(new BooleanFromFloatExpression());93 interpreter.FloatStack.Push(2.0); 94 interpreter.Run(new BooleanFromFloatExpression()); 95 95 96 Assert.AreEqual(true, this.interpreter.BooleanStack.Top);96 Assert.AreEqual(true, interpreter.BooleanStack.Top); 97 97 98 this.TestStackCounts(booleanStack: 1);98 TestStackCounts(booleanStack: 1); 99 99 } 100 100 … … 104 104 [TestCategory("BooleanExpressionTest")] 105 105 public void TestFromFloatWithInsufficientArguments() { 106 this.TestWithInsufficientArguments("FROMFLOAT");106 TestWithInsufficientArguments("FROMFLOAT"); 107 107 } 108 108 … … 112 112 [TestCategory("BooleanExpressionTest")] 113 113 public void TestFromInteger() { 114 this.interpreter.IntegerStack.Push(2);115 this.interpreter.Run(new BooleanFromIntegerExpression());114 interpreter.IntegerStack.Push(2); 115 interpreter.Run(new BooleanFromIntegerExpression()); 116 116 117 Assert.AreEqual(true, this.interpreter.BooleanStack.Top);117 Assert.AreEqual(true, interpreter.BooleanStack.Top); 118 118 119 this.TestStackCounts(booleanStack: 1);119 TestStackCounts(booleanStack: 1); 120 120 } 121 121 … … 125 125 [TestCategory("BooleanExpressionTest")] 126 126 public void TestFromIntegerWithInsufficientArguments() { 127 this.TestWithInsufficientArguments("FROMINTEGER");127 TestWithInsufficientArguments("FROMINTEGER"); 128 128 } 129 129 … … 137 137 138 138 protected override void CheckOtherStacksAreEmpty() { 139 this.TestStackCounts(booleanStack: null);139 TestStackCounts(booleanStack: null); 140 140 } 141 141 }
Note: See TracChangeset
for help on using the changeset viewer.