[gbrainy/gbrainy_15x] Allow operator answer without separators



commit ed0663243fb8b7bf8050d05afab2411b64f4b592
Author: Jordi Mas <jmas softcatala org>
Date:   Sat May 22 12:17:01 2010 +0200

    Allow operator answer without separators

 src/Games/Calculation/CalculationOperator.cs |    2 +-
 tests/Core/GameTest.cs                       |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/Games/Calculation/CalculationOperator.cs b/src/Games/Calculation/CalculationOperator.cs
index 9a2c3b5..ff59ca4 100644
--- a/src/Games/Calculation/CalculationOperator.cs
+++ b/src/Games/Calculation/CalculationOperator.cs
@@ -50,7 +50,7 @@ namespace gbrainy.Games.Calculation
 		}
 
 		public override string AnswerCheckExpression {
-			get { return "[+*-/]+"; }
+			get { return "[+*-/]"; }
 		}
 
 		public override AnswerCheckAttributes CheckAttributes {
diff --git a/tests/Core/GameTest.cs b/tests/Core/GameTest.cs
index 1bfe544..340a20d 100644
--- a/tests/Core/GameTest.cs
+++ b/tests/Core/GameTest.cs
@@ -220,12 +220,13 @@ namespace gbrainyTest
 		{
 			TestGame game = new TestGame ();
 			game.RightAnswer = "+ | -";
-			game.Expression = "[+*-/]+";
+			game.Expression = "[+*-/]";
 			game.Attributes = Game.AnswerCheckAttributes.Trim | Game.AnswerCheckAttributes.MatchAllInOrder;
 
 			Assert.AreEqual (true, game.CheckAnswer ("+ i -"));
 			Assert.AreEqual (true, game.CheckAnswer ("+ and -"));
 			Assert.AreEqual (true, game.CheckAnswer ("+ -"));
+			Assert.AreEqual (true, game.CheckAnswer ("+-"));
 
 			Assert.AreEqual (false, game.CheckAnswer ("- +"));
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]