Exemple #1
0
        public void Test_NotEqualsDiffFieldCount()
        {
            //---------------Set up test pack-------------------
            UIFormColumn uiFormColumn1 = new UIFormColumn();
            UIFormField  def           = CreateUIFormField("bob", "bob");

            uiFormColumn1.Add(def);
            UIFormColumn uiFormColumn2 = new UIFormColumn();

            uiFormColumn2.Add(def);
            UIFormField def2 = CreateUIFormField("bob1", "bob1");

            uiFormColumn1.Add(def);
            uiFormColumn1.Add(def2);
            uiFormColumn2.Add(def2);
            //--------------Assert PreConditions----------------
            Assert.AreNotEqual(uiFormColumn1.Count, uiFormColumn2.Count);
            //---------------Execute Test ----------------------
            bool operatorEquals     = uiFormColumn1 == uiFormColumn2;
            bool equalsMethod       = uiFormColumn1.Equals(uiFormColumn2);
            bool equalsObjectMethod = uiFormColumn1.Equals((object)uiFormColumn2);

            //---------------Test Result -----------------------
            Assert.IsFalse(operatorEquals);
            Assert.IsFalse(equalsMethod);
            Assert.IsFalse(equalsObjectMethod);
            //---------------Tear Down -------------------------
        }
Exemple #2
0
        public void Test_NotEqualsNull()
        {
            UIFormColumn       uiFormColumn1 = new UIFormColumn();
            const UIFormColumn uiFormColumn2 = null;

            Assert.IsFalse(uiFormColumn1 == uiFormColumn2);
            Assert.IsFalse(uiFormColumn2 == uiFormColumn1);
            Assert.IsFalse(uiFormColumn1.Equals(uiFormColumn2));
            Assert.IsFalse(uiFormColumn1.Equals((object)uiFormColumn2));
        }
Exemple #3
0
        public void Test_NotEquals()
        {
            UIFormColumn uiFormColumn1 = new UIFormColumn();
            UIFormField  def           = CreateUIFormField("bob", "bob");

            uiFormColumn1.Add(def);
            UIFormColumn uiFormColumn2 = new UIFormColumn();
            UIFormField  def2          = CreateUIFormField("bob1", "bob1");

            uiFormColumn2.Add(def2);
            Assert.IsFalse(uiFormColumn1 == uiFormColumn2);
            Assert.IsFalse(uiFormColumn2 == uiFormColumn1);
            Assert.IsFalse(uiFormColumn1.Equals(uiFormColumn2));
            Assert.IsFalse(uiFormColumn1.Equals((object)uiFormColumn2));
        }
Exemple #4
0
        public void TestEquals()
        {
            UIFormColumn uiFormColumn1 = new UIFormColumn();
            UIFormField  def           = CreateUIFormField();

            uiFormColumn1.Add(def);
            UIFormColumn uiFormColumn2 = new UIFormColumn();

            uiFormColumn2.Add(def);
            Assert.IsTrue(uiFormColumn1 == uiFormColumn2);
            Assert.IsTrue(uiFormColumn2 == uiFormColumn1);
            Assert.IsFalse(uiFormColumn2 != uiFormColumn1);
            Assert.IsTrue(uiFormColumn1.Equals(uiFormColumn2));
            Assert.IsTrue(uiFormColumn1.Equals((object)uiFormColumn2));
        }
Exemple #5
0
        public void Test_NotEquals_FormColumnWidthDiff()
        {
            //---------------Set up test pack-------------------
            UIFormColumn uiFormColumn1 = new UIFormColumn(10);
            UIFormColumn uiFormColumn2 = new UIFormColumn(20);

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

            //---------------Execute Test ----------------------
            Assert.IsFalse(uiFormColumn1 == uiFormColumn2);
            Assert.IsFalse(uiFormColumn2 == uiFormColumn1);
            Assert.IsFalse(uiFormColumn1.Equals(uiFormColumn2));
            Assert.IsFalse(uiFormColumn1.Equals((object)uiFormColumn2));
            //---------------Test Result -----------------------

            //---------------Tear Down -------------------------
        }
Exemple #6
0
        public void Test_NotEquals_SameFirstItemDiffSecondItem()
        {
            UIFormColumn uiFormColumn1 = new UIFormColumn();
            UIFormField  def           = CreateUIFormField("bob", "bob");

            uiFormColumn1.Add(def);
            UIFormColumn uiFormColumn2 = new UIFormColumn();

            uiFormColumn2.Add(def);
            UIFormField def2 = CreateUIFormField("bob1", "bob1");

            uiFormColumn2.Add(def2);
            Assert.IsFalse(uiFormColumn1 == uiFormColumn2);
            Assert.IsTrue(uiFormColumn1 != uiFormColumn2);
            Assert.IsFalse(uiFormColumn2 == uiFormColumn1);
            Assert.IsFalse(uiFormColumn1.Equals(uiFormColumn2));
            Assert.IsFalse(uiFormColumn1.Equals((object)uiFormColumn2));
        }
Exemple #7
0
        public void TestCloneUIFormColumn()
        {
            //---------------Set up test pack-------------------
            UIFormField  field1       = CreateUIFormField();
            UIFormField  field2       = CreateUIFormField();
            UIFormColumn uiFormColumn = new UIFormColumn();

            uiFormColumn.Add(field1);
            uiFormColumn.Add(field2);
            uiFormColumn.Width = 44;

            //---------------Execute Test ----------------------
            IUIFormColumn clonedFormColumn = uiFormColumn.Clone();

            //---------------Test Result -----------------------
            Assert.IsTrue(uiFormColumn == (UIFormColumn)clonedFormColumn);

            Assert.IsTrue(uiFormColumn.Equals(clonedFormColumn));
            Assert.AreSame(uiFormColumn[0], clonedFormColumn[0]);
        }