コード例 #1
0
        public override bool Equals(object obj)
        {
            ComplexBindingPropertiesAttribute other = obj as ComplexBindingPropertiesAttribute;

            return(other != null &&
                   other.DataSource == DataSource &&
                   other.DataMember == DataMember);
        }
		public void EqualsTest ()
		{
			ComplexBindingPropertiesAttribute a;

			a = new ComplexBindingPropertiesAttribute ("source", "member");
			Assert.IsFalse (a.Equals (null), "1");
			Assert.IsFalse (a.Equals (new ComplexBindingPropertiesAttribute ("member", "source")), "2");
			Assert.IsTrue (a.Equals (new ComplexBindingPropertiesAttribute ("source", "member")), "3");
		}
コード例 #3
0
		public void GetHashCodeTest ()
		{
			ComplexBindingPropertiesAttribute a;

			a = new ComplexBindingPropertiesAttribute ("source", "member");
			Assert.IsFalse (0 == a.GetHashCode (), "1");

			a = new ComplexBindingPropertiesAttribute ("source");
			Assert.IsFalse (0 == a.GetHashCode (), "2");
		}
		public void CtorTest ()
		{
			ComplexBindingPropertiesAttribute a;

			a = new ComplexBindingPropertiesAttribute ("source", "member");
			Assert.AreEqual ("source", a.DataSource, "1");
			Assert.AreEqual ("member", a.DataMember, "2");

			a = new ComplexBindingPropertiesAttribute ("source");
			Assert.AreEqual ("source", a.DataSource, "3");
			Assert.AreEqual (null, a.DataMember, "4");

			a = new ComplexBindingPropertiesAttribute ();
			Assert.AreEqual (null, a.DataSource, "5");
			Assert.AreEqual (null, a.DataMember, "6");
		}
コード例 #5
0
        public override bool Equals(object obj)
        {
            ComplexBindingPropertiesAttribute attribute = obj as ComplexBindingPropertiesAttribute;

            return(((attribute != null) && (attribute.DataSource == this.dataSource)) && (attribute.DataMember == this.dataMember));
        }