public void EqualsTest () { string foo_built = new StringBuilder ("f").Append ("oo").ToString (); ToolboxDataAttribute left = new ToolboxDataAttribute (foo_built); ToolboxDataAttribute right = new ToolboxDataAttribute ("foo"); Assert.IsTrue (left.Equals (right), "Equals True"); right = new ToolboxDataAttribute ("bar"); Assert.IsFalse (left.Equals (right), "Equals False"); Assert.IsFalse (left.Equals (45), "Equals Int"); Assert.IsFalse (left.Equals ("foo"), "Equals String"); }
public void Deny_Unrestricted () { ToolboxDataAttribute tda = new ToolboxDataAttribute (null); Assert.IsNull (tda.Data, "Data"); Assert.IsTrue (tda.Equals (tda), "Equals"); Assert.IsFalse (tda.GetHashCode () == ToolboxDataAttribute.Default.GetHashCode (), "GetHashCode"); // unexpected result as tda hash code is different from default // seems that null and String.Empty are both considered defaults... Assert.IsTrue (tda.IsDefaultAttribute (), "IsDefaultAttribute"); }