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