Example #1
0
 public void Test_Clone1()
 {
     var variable = new Var('a'); 
     var variable1 = variable.Clone();
     variable1.Token = "b";
     Assert.True(variable.Token.Equals('a'));
     Assert.True(variable.ToString().Equals("a"));
 }
Example #2
0
 public void Test_Line_TruePositive_7()
 {
     //cy=0
     var c = new Var('c');
     const string txt = "cy=0";
     Expr expr = Text.Convert(txt);
     object obj;
     LineSymbol ls;
     bool result = expr.IsEquation(out obj);
     Assert.True(result);
     var eq = obj as Equation;
     Assert.NotNull(eq);
     result = eq.IsLineEquation(out ls);
     Assert.True(result);
     Assert.Null(ls.SymA);
     Assert.True(ls.SymB.Equals(c.ToString()));
     Assert.True(ls.SymC.Equals("0"));
 }
Example #3
0
 public void Test_Line_TruePositive_5()
 {
     //ax=2
     var a = new Var('a');
     const string txt = "ax=2";
     Expr expr = Text.Convert(txt);
     object obj;
     LineSymbol ls;
     bool result = expr.IsEquation(out obj);
     Assert.True(result);
     var eq = obj as Equation;
     Assert.NotNull(eq);
     result = eq.IsLineEquation(out ls);
     Assert.True(result);
     Assert.NotNull(ls);
     Assert.True(ls.SymA.Equals(a.ToString()));
     Assert.Null(ls.SymB);
     Assert.True(ls.SymC.Equals("-2"));
 }