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); }
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()); }
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()); }
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 ------------------------- }
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); }
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 ------------------------- }