Index: branches/2886_SymRegGrammarEnumeration/Test/GrammarEnumerationTest.cs
===================================================================
--- branches/2886_SymRegGrammarEnumeration/Test/GrammarEnumerationTest.cs	(revision 15712)
+++ branches/2886_SymRegGrammarEnumeration/Test/GrammarEnumerationTest.cs	(revision 15714)
@@ -10,5 +10,5 @@
 
 namespace HeuristicLab.Algorithms.DataAnalysis.MctsSymbolicRegression {
-  [TestClass()]
+  //[TestClass()]
   public class MctsSymbolicRegressionTest {
     private const int Seed = 1234;
Index: branches/2886_SymRegGrammarEnumeration/Test/Test.csproj
===================================================================
--- branches/2886_SymRegGrammarEnumeration/Test/Test.csproj	(revision 15712)
+++ branches/2886_SymRegGrammarEnumeration/Test/Test.csproj	(revision 15714)
@@ -103,5 +103,7 @@
     <Otherwise>
       <ItemGroup>
-        <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
+        <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework">
+          <Private>False</Private>
+        </Reference>
       </ItemGroup>
     </Otherwise>
@@ -110,4 +112,5 @@
     <Compile Include="GrammarEnumerationTest.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="TreeHashingTest.cs" />
   </ItemGroup>
   <ItemGroup>
Index: branches/2886_SymRegGrammarEnumeration/Test/TreeHashingTest.cs
===================================================================
--- branches/2886_SymRegGrammarEnumeration/Test/TreeHashingTest.cs	(revision 15714)
+++ branches/2886_SymRegGrammarEnumeration/Test/TreeHashingTest.cs	(revision 15714)
@@ -0,0 +1,84 @@
+﻿using System.Linq;
+using HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration;
+using HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration.GrammarEnumeration;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace Test {
+  [TestClass]
+  public class TreeHashingTest {
+
+    private Grammar grammar;
+    private TerminalSymbol varA;
+    private TerminalSymbol varB;
+    private TerminalSymbol varC;
+
+    [TestInitialize]
+    public void InitTest() {
+      grammar = new Grammar(new[] { "a", "b", "c" });
+
+      varA = grammar.Var.VariableTerminalSymbols.First(s => s.StringRepresentation == "a");
+      varB = grammar.Var.VariableTerminalSymbols.First(s => s.StringRepresentation == "b");
+      varC = grammar.Var.VariableTerminalSymbols.First(s => s.StringRepresentation == "c");
+    }
+
+    [TestMethod]
+    [TestCategory("TreeHashing")]
+    public void SimpleEqualityAddition() {
+      SymbolString s1 = new SymbolString(new[] { varA, varB, grammar.Addition, varC, grammar.Addition });
+      SymbolString s2 = new SymbolString(new[] { varA, varB, grammar.Addition, varC, grammar.Addition });
+
+      int hash1 = grammar.CalcHashCode(s1);
+      int hash2 = grammar.CalcHashCode(s2);
+
+      Assert.AreEqual(hash1, hash2);
+    }
+
+    [TestMethod]
+    [TestCategory("TreeHashing")]
+    public void SimpleInequalityAddition() {
+      SymbolString s1 = new SymbolString(new[] { varA, varB, grammar.Addition, varC, grammar.Addition });
+      SymbolString s2 = new SymbolString(new[] { varB, varB, grammar.Addition, varB, grammar.Addition });
+
+      int hash1 = grammar.CalcHashCode(s1);
+      int hash2 = grammar.CalcHashCode(s2);
+
+      Assert.AreNotEqual(hash1, hash2);
+    }
+
+    [TestMethod]
+    [TestCategory("TreeHashing")]
+    public void CommutativityAddition() {
+      SymbolString s1 = new SymbolString(new[] { varA, varB, grammar.Addition });
+      SymbolString s2 = new SymbolString(new[] { varB, varA, grammar.Addition });
+
+      int hash1 = grammar.CalcHashCode(s1);
+      int hash2 = grammar.CalcHashCode(s2);
+
+      Assert.AreEqual(hash1, hash2);
+    }
+
+    [TestMethod]
+    [TestCategory("TreeHashing")]
+    public void AssociativityAddition() {
+      SymbolString s1 = new SymbolString(new[] { varA, varB, grammar.Addition, varA, grammar.Addition });
+      SymbolString s2 = new SymbolString(new[] { varA, varB, varA, grammar.Addition, grammar.Addition });
+
+      int hash1 = grammar.CalcHashCode(s1);
+      int hash2 = grammar.CalcHashCode(s2);
+
+      Assert.AreEqual(hash1, hash2);
+    }
+
+    [TestMethod]
+    [TestCategory("TreeHashing")]
+    public void RepeatedAddition() {
+      SymbolString s1 = new SymbolString(new[] { varA, varA, grammar.Addition, varA, grammar.Addition });
+      SymbolString s2 = new SymbolString(new[] { varA });
+
+      int hash1 = grammar.CalcHashCode(s1);
+      int hash2 = grammar.CalcHashCode(s2);
+
+      Assert.AreEqual(hash1, hash2);
+    }
+  }
+}
