public void DifferentResolvedNamesShouldHaveDifferentHashCodes()
            {
                SymbolicName name1 = SymbolicName.Of("a");
                SymbolicName name2 = SymbolicName.Of("b");

                name1.GetHashCode().ShouldNotBe(name2.GetHashCode());
            }
            public void EqualsShouldWorkDifferentValue()
            {
                SymbolicName name1 = SymbolicName.Of("a");
                SymbolicName name2 = SymbolicName.Of("b");

                name1.ShouldNotBe(name2);
            }
            public void EqualsShouldWorkSameValue()
            {
                SymbolicName name1 = SymbolicName.Of("a");
                SymbolicName name2 = name1;
                SymbolicName name3 = SymbolicName.Of("a");

                name1.ShouldBeEquivalentTo(name2);
                name1.ShouldBeEquivalentTo(name3);
            }
        public void ShouldNotEqualResolved()
        {
            SymbolicName name1 = SymbolicName.Unresolved();

            name1.ShouldNotBe(SymbolicName.Of("a"));
        }
Exemple #5
0
 /// <summary>
 /// Creates a copy of this node with a new symbolic name.
 /// </summary>
 /// <param name="newSymbolicName">The new symbolic name.</param>
 /// <returns>The new node</returns>
 public Node Named(string newSymbolicName)
 {
     Ensure.HasText(newSymbolicName, "Symbolic name is required");
     return(new Node(SymbolicName.Of(newSymbolicName), Properties, Labels));
 }