public void Constructor ()
		{
			var a = new DataKeyPropertyAttribute (null);
			Assert.AreEqual (null, a.Name, "#A1");

			a = new DataKeyPropertyAttribute ("test");
			Assert.AreEqual ("test", a.Name, "#A2");
		}
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            DataKeyPropertyAttribute other = obj as DataKeyPropertyAttribute;

            if (other != null)
            {
                return(String.Equals(_name, other.Name, StringComparison.Ordinal));
            }
            return(false);
        }
		public void EqualsTest ()
		{
			var a = new DataKeyPropertyAttribute (null);

			Assert.IsFalse (a.Equals (null), "#A1-1");
			Assert.IsFalse (a.Equals ("test"), "#A1-2");

			a = new DataKeyPropertyAttribute ("test");
			Assert.IsFalse (a.Equals ("test"), "#A2-1");
			Assert.IsTrue (a.Equals ((object)new DataKeyPropertyAttribute ("test")), "#A2-2");
			Assert.IsFalse (a.Equals (new DataKeyPropertyAttribute ("invalid")), "#A2-3");
			Assert.IsFalse (a.Equals ((object) new DataKeyPropertyAttribute ("TEST")), "#A2-3");
		}
        public override bool Equals(object obj)
        {
            DataKeyPropertyAttribute attribute = obj as DataKeyPropertyAttribute;

            return((attribute != null) && string.Equals(this._name, attribute.Name, StringComparison.Ordinal));
        }