Example #1
0
 public void TestUnclosedBrackets()
 {
     Assert.Throws <IncorrectSyntaxException>(
         () => SimpleParser.Parse("1+2/(3-4")
         );
 }
Example #2
0
 public void TestUnopenedBracket()
 {
     Assert.Throws <IncorrectSyntaxException>(
         () => SimpleParser.Parse("(((a))))+5")
         );
 }
Example #3
0
 public void TestEmptyBrackets()
 {
     Assert.Throws <IncorrectSyntaxException>(
         () => SimpleParser.Parse("1*(1+5/())")
         );
 }
Example #4
0
 public void TestBracketsAfterLiteral()
 {
     Assert.Throws <IncorrectSyntaxException>(
         () => SimpleParser.Parse("1(1+5)")
         );
 }
Example #5
0
 public void TestTwoOperands()
 {
     Assert.Throws <IncorrectSyntaxException>(
         () => SimpleParser.Parse("1+*12")
         );
 }
Example #6
0
 public void NonOpenedBrackets()
 {
     Assert.Throws <IncorrectSyntaxException>(
         () => SimpleParser.Parse("1+2*3)")
         );
 }
Example #7
0
 public void TestOperationsWithoutNeededOperands()
 {
     Assert.Throws <IncorrectSyntaxException>(
         () => SimpleParser.Parse("1+")
         );
 }