public void TestHashCodeTrue()
 {
     Formula a = new Formula("2 + X3");
     int hashCodeA = a.GetHashCode();
     Formula b = new Formula("2+X3");
     int hashCodeB = b.GetHashCode();
     Assert.AreEqual(hashCodeA, hashCodeB);
 }
示例#2
0
 public void TestGetHashCode()
 {
     Formula f1 = new Formula("x1+y2", Normalize, Validate);
     Formula f2 = new Formula("X1+Y2");
     Assert.IsTrue(f1.GetHashCode() == f2.GetHashCode());
 }
示例#3
0
 public void Test45()
 {
     Formula f1 = new Formula("2*5");
     Formula f2 = new Formula("3/8*2+(7)");
     Assert.IsTrue(f1.GetHashCode() != f2.GetHashCode());
 }
示例#4
0
 public void Test44()
 {
     Formula f1 = new Formula("2*5");
     Formula f2 = new Formula("2*5");
     Assert.IsTrue(f1.GetHashCode() == f2.GetHashCode());
 }
示例#5
0
 public void TestGetHashCode2()
 {
     Formula testFormula1 = new Formula("a/b");
     Formula testFormula2 = new Formula("b/a");
     Assert.IsFalse(testFormula1.GetHashCode() == testFormula2.GetHashCode());
 }
示例#6
0
 public void TestGetHashCode1()
 {
     Formula testFormula1 = new Formula("a/b");
     Formula testFormula2 = new Formula("a/b");
     Assert.IsTrue(testFormula1.GetHashCode() == testFormula2.GetHashCode());
 }
示例#7
0
 public void GetHashcodeTest()
 {
     Formula f1 = new Formula("x+2");
     Formula f2 = new Formula("x+2");
     Assert.IsTrue(f1.GetHashCode() == f2.GetHashCode());
 }
示例#8
0
 public void PublicTestGetHashCode4WithNormalizer()
 {
     Formula f1 = new Formula("5+A1");
     Formula f2 = new Formula("5+a1", s =>s.ToUpper(), s => true);
     Assert.AreEqual(f1.GetHashCode(), f2.GetHashCode());
 }
示例#9
0
 public void PublicTestGetHashCode4()
 {
     Formula f1 = new Formula("5+A1");
     Formula f2 = new Formula("5+a1");
     Assert.AreNotEqual(f1.GetHashCode(), f2.GetHashCode());
 }
示例#10
0
 public void PublicTestGetHashCode3()
 {
     Formula f1 = new Formula("5+6e+3");
     Formula f2 = new Formula("5+6000");
     Assert.AreNotEqual(f1.GetHashCode(), f2.GetHashCode());
 }
示例#11
0
 public void PublicTestGetHashCode1()
 {
     Formula f1 = new Formula("5+A1-72/8+1/2");
     Formula f2 = new Formula("5 +A1 - 72 / 8 + 1 / 2");
     Assert.AreEqual(f1.GetHashCode(), f2.GetHashCode());
 }
 public void TestHashCodeFalse()
 {
     Formula a = new Formula("2 + 3");
     int hashCodeA = a.GetHashCode();
     Formula b = new Formula("3 + 2");
     int hashCodeB = b.GetHashCode();
     Assert.AreNotEqual(hashCodeA, hashCodeB);
 }
示例#13
0
 public void HashCodeNotEqual()
 {
     Formula f = new Formula("x1 + y2 + z3");
     int fHash = f.GetHashCode();
     Formula g = new Formula("X1 + Y2 + Z3");
     int gHash = g.GetHashCode();
     Assert.AreNotEqual(gHash, fHash);
 }
示例#14
0
 public void HashCodeEqualWithUpper()
 {
     Formula f = new Formula("x1 + y2 + z3", s => s.ToUpper(), s => true);
     int fHash = f.GetHashCode();
     Formula g = new Formula("X1 + Y2 + Z3");
     int gHash = g.GetHashCode();
     Assert.AreEqual(gHash, fHash);
 }