public void ToString4() { Formula f1 = new Formula("a+b*(c-15)/2"); Formula f2 = new Formula(f1.ToString()); Assert.AreEqual(24.0, f2.Evaluate(s => char.IsLower(s[0]) ? 16 : 0), 1e-6); }
public void ToString3() { Formula f1 = new Formula("x", s => s.ToUpper(), s => true); Formula f2 = new Formula(f1.ToString()); Assert.AreEqual(8.0, f2.Evaluate(s => (s == "X") ? 8 : 0), 1e-6); }
public void ToString6() { Formula f1 = new Formula("a+b*(c-15)/2", s => s.ToUpper(), s => true); Formula f2 = new Formula(f1.ToString()); Assert.AreEqual(24.0, f2.Evaluate(s => char.IsUpper(s[0]) ? 16 : 0), 1e-6); }
public void ToString2() { Formula f1 = new Formula("x"); Formula f2 = new Formula(f1.ToString()); Assert.AreEqual(8.0, f2.Evaluate(s => (s == "x") ? 8 : 0), 1e-6); }
public void UltimateToStringTest() { Formula f = new Formula("(1 + 2 + 3 * 4 + 5) * 2 + a"); Formula g = new Formula(f.ToString()); Assert.AreEqual(f.Evaluate(TestLookup), g.Evaluate(TestLookup)); }
public void ZeroArg4() { Formula f1 = new Formula(); Formula f2 = new Formula(f1.ToString()); Assert.AreEqual(0, f2.Evaluate(s => 1)); }
public void ToString1() { Formula f1 = new Formula("7"); Formula f2 = new Formula(f1.ToString()); Assert.AreEqual(7.0, f2.Evaluate(s => 0), 1e-6); }
public void Test34() { Formula f = new Formula("((((x1+x2)+x3)+x4)+x5)+x6"); Formula t = new Formula(f.ToString()); Assert.AreEqual(12, (double)t.Evaluate(s => 2), 1e-9); }
public void TestToString1() { string s = "x+ 6"; Formula g = new Formula(s); Assert.AreEqual(g.ToString(), s); }
public void ToString3() { Formula f1 = new Formula("x", s => s.ToUpper(), s => true); Formula f2 = new Formula(f1.ToString()); Assert.AreEqual(8.0, f2.Evaluate(s => (s == "X") ? 8 : 0), 1e-6); }
public void TestToStringNormalized() { Formula f = new Formula("POTATO - B33R + 17.0 + .12e12", s => s.ToLower(), s => Char.IsLetter(s[0])); Assert.AreEqual("potato - b33r + 17.0 + .12e12", f.ToString()); }
public void TestToString() { Formula f = new Formula("(((1 + 2) / 3) * 10) - 4"); Assert.AreEqual("(((1 + 2) / 3) * 10) - 4", f.ToString()); }
public void TestToStringEmptyConstructor() { Formula f = new Formula(); Assert.AreEqual("0", f.ToString()); }
public void ZeroArg4() { Formula f1 = new Formula(); Formula f2 = new Formula(f1.ToString()); Assert.AreEqual(0, f2.Evaluate(s => 1)); }
public void ToString6() { Formula f1 = new Formula("a+b*(c-15)/2", s => s.ToUpper(), s => true); Formula f2 = new Formula(f1.ToString()); Assert.AreEqual(24.0, f2.Evaluate(s => char.IsUpper(s[0]) ? 16 : 0), 1e-6); }
public void ToString2() { Formula f1 = new Formula("x"); Formula f2 = new Formula(f1.ToString()); Assert.AreEqual(8.0, f2.Evaluate(s => (s == "x") ? 8 : 0), 1e-6); }
public void ToString1() { Formula f1 = new Formula("7"); Formula f2 = new Formula(f1.ToString()); Assert.AreEqual(7.0, f2.Evaluate(s => 0), 1e-6); }
public void TestToStringZero() { Formula g = new Formula("0"); Assert.AreEqual(g.ToString(), "0"); }
public void ToString4() { Formula f1 = new Formula("a+b*(c-15)/2"); Formula f2 = new Formula(f1.ToString()); Assert.AreEqual(24.0, f2.Evaluate(s => char.IsLower(s[0]) ? 16 : 0), 1e-6); }