Equals() public method

Determines whether the specified is equal to the current .
public Equals ( object obj ) : bool
obj object The to compare with the current .
return bool
Exemplo n.º 1
0
        public void Test_NotEqual_Heading()
        {
            //---------------Set up test pack-------------------
            UIGridColumn gridColumn1 = new UIGridColumn("pp", "pp", "", "", false, 0, PropAlignment.centre, null);
            UIGridColumn gridColumn2 = new UIGridColumn("pp1", "pp", "", "", false, 0, PropAlignment.centre, null);

            //--------------Assert PreConditions----------------            

            //---------------Execute Test ----------------------
            bool operatorEquals = gridColumn1 == gridColumn2;
            bool operatorNotEquals = gridColumn1 != gridColumn2;
            bool methodEquals = gridColumn1.Equals(gridColumn2);

            //---------------Test Result -----------------------
            Assert.IsFalse(methodEquals);
            Assert.IsFalse(operatorEquals);
            Assert.IsTrue(operatorNotEquals);
            //---------------Tear Down -------------------------          
        }
Exemplo n.º 2
0
        public void Test_NotSameType()
        {
            //---------------Set up test pack-------------------
            UIGridColumn gridColumn = new UIGridColumn("", "", "", "", false, 0, PropAlignment.centre, null);
            //--------------Assert PreConditions----------------            

            //---------------Execute Test ----------------------
            bool methodEquals = gridColumn.Equals("fedafds");

            //---------------Test Result -----------------------
            Assert.IsFalse(methodEquals);
            //---------------Tear Down -------------------------          
        }
Exemplo n.º 3
0
 public void Test_NotEqualsNull()
 {
     UIGridColumn uiGridColumn1 = new UIGridColumn("", "", "", "",false,0,PropAlignment.centre, null);
     UIGridColumn uiGridColumn2 = null;
     Assert.IsFalse(uiGridColumn1 == uiGridColumn2);
     Assert.IsTrue(uiGridColumn1 != uiGridColumn2);
     Assert.IsFalse(uiGridColumn1.Equals(uiGridColumn2));
     Assert.AreNotEqual(uiGridColumn1, uiGridColumn2);
 }
Exemplo n.º 4
0
        public void Test_HashCodeNotEquals()
        {
            //---------------Set up test pack-------------------
            UIGridColumn gridColumn = new UIGridColumn("pp", "pp", "", "", false, 0, PropAlignment.centre, null);
            UIGridColumn otherColumn = new UIGridColumn("pp", "qq", "", "", false, 0, PropAlignment.centre, null);

            //---------------Assert preconditions----------------
            Assert.IsFalse(gridColumn.Equals(otherColumn));
            //---------------Execute Test ----------------------
            //---------------Test Result -----------------------
            Assert.AreNotEqual(gridColumn.GetHashCode(), otherColumn.GetHashCode());
        }
Exemplo n.º 5
0
        public void Test_HashCodeEquals()
        {
            //---------------Set up test pack-------------------
            UIGridColumn gridColumn = new UIGridColumn("pp", "pp", "", "", false, 0, PropAlignment.centre, null);
            IUIGridColumn clonedGridColumn = gridColumn.Clone();

            //---------------Assert preconditions----------------
            Assert.IsTrue(gridColumn.Equals(clonedGridColumn));
            //---------------Execute Test ----------------------
            //---------------Test Result -----------------------
            Assert.AreEqual(gridColumn.GetHashCode(), clonedGridColumn.GetHashCode());
        }
Exemplo n.º 6
0
        public void TestCloneGridColumn()
        {
            //---------------Set up test pack-------------------
            UIGridColumn gridColumn = new UIGridColumn("pp", "pp", "", "", false, 0, PropAlignment.centre, null);

            //---------------Execute Test ----------------------
            IUIGridColumn clonedGridColumn = gridColumn.Clone();

            //---------------Test Result -----------------------
            Assert.IsTrue(gridColumn.Equals(clonedGridColumn));
            Assert.IsTrue(gridColumn == (UIGridColumn) clonedGridColumn);
            Assert.IsFalse(gridColumn != (UIGridColumn) clonedGridColumn);
        }