Exemplo n.º 1
0
        public void TestNotEquals_DifferentField()
        {
            UIFormTab    uiFormTab1    = new UIFormTab();
            UIFormColumn uiFormColumn1 = CreateUIFormColumn_2Fields();
            UIFormColumn uiFormColumn2 = CreateUIFormColumn_2Fields("diffProp");
            UIFormTab    uiFormTab2    = new UIFormTab();

            uiFormTab1.Add(uiFormColumn1);

            uiFormTab2.Add(uiFormColumn2);

            Assert.IsFalse(uiFormTab2 == uiFormTab1);
            Assert.IsTrue(uiFormTab2 != uiFormTab1);
            Assert.IsFalse(uiFormTab1.Equals(uiFormTab2));
            //Assert.AreNotEqual(uiFormTab1, uiFormTab2);
        }
Exemplo n.º 2
0
        public void TestNotEquals_DifferentTabName()
        {
            //---------------Set up test pack-------------------
            UIFormTab uiFormTab1 = new UIFormTab("tab1");

            uiFormTab1.Add(CreateUIFormColumn_2Fields());
            UIFormTab uiFormTab2 = new UIFormTab("tab2");

            uiFormTab2.Add(CreateUIFormColumn_2Fields());

            //--------------Assert PreConditions----------------
            Assert.AreNotEqual(uiFormTab2.Name, uiFormTab1.Name);
            //---------------Execute Test ----------------------
            Assert.IsFalse(uiFormTab2 == uiFormTab1);
            Assert.IsFalse(uiFormTab1.Equals(uiFormTab2));
            //Assert.AreNotEqual(uiFormTab1, uiFormTab2);
            //---------------Test Result -----------------------

            //---------------Tear Down -------------------------
        }
Exemplo n.º 3
0
        public void TestNotEquals_DiffColCount()
        {
            //---------------Set up test pack-------------------
            UIFormTab    uiFormTab1    = new UIFormTab();
            UIFormColumn uiFormColumn1 = CreateUIFormColumn_2Fields();
            UIFormColumn uiFormColumn2 = CreateUIFormColumn_2Fields("diffProp");
            UIFormTab    uiFormTab2    = new UIFormTab();


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

            //---------------Execute Test ----------------------
            uiFormTab1.Add(uiFormColumn1);
            uiFormTab1.Add(uiFormColumn2);

            uiFormTab2.Add(uiFormColumn2);
            //---------------Test Result -----------------------
            Assert.IsFalse(uiFormTab2 == uiFormTab1);
            Assert.IsFalse(uiFormTab1.Equals(uiFormTab2));
            //---------------Tear Down -------------------------
        }
Exemplo n.º 4
0
        public void TestCloneUIFormTab()
        {
            //---------------Set up test pack-------------------
            UIFormField  field1       = CreateUIFormField("label1", "prop1", null);
            UIFormField  field2       = CreateUIFormField("label2", "prop2", null);
            UIFormColumn uiFormColumn = new UIFormColumn();

            uiFormColumn.Add(field1);
            uiFormColumn.Add(field2);

            UIFormTab uiFormTab = new UIFormTab("Tab1");

            uiFormTab.Add(uiFormColumn);

            //---------------Execute Test ----------------------
            IUIFormTab clonedFormTab = uiFormTab.Clone();

            //---------------Test Result -----------------------
            Assert.IsTrue(uiFormTab == (UIFormTab)clonedFormTab);
            Assert.IsTrue(uiFormTab.Equals(clonedFormTab));
            Assert.AreEqual(uiFormTab[0], clonedFormTab[0],
                            "Should be a deep copy and the columns should be equal but copied");
            Assert.AreNotSame(uiFormTab[0], clonedFormTab[0], "Should be a deep copy and the columns should be equal but copied (not same)");
        }
Exemplo n.º 5
0
        public void TestCloneUIFormTab()
        {
            //---------------Set up test pack-------------------
            UIFormField field1 = CreateUIFormField("label1", "prop1", null);
            UIFormField field2 = CreateUIFormField("label2", "prop2", null); 
            UIFormColumn uiFormColumn = new UIFormColumn();
            uiFormColumn.Add(field1);
            uiFormColumn.Add(field2);

            UIFormTab uiFormTab = new UIFormTab("Tab1");
            uiFormTab.Add(uiFormColumn);

            //---------------Execute Test ----------------------
            IUIFormTab clonedFormTab = uiFormTab.Clone();

            //---------------Test Result -----------------------
            Assert.IsTrue(uiFormTab == (UIFormTab) clonedFormTab);
            Assert.IsTrue(uiFormTab.Equals(clonedFormTab));
            Assert.AreEqual(uiFormTab[0], clonedFormTab[0],
                              "Should be a deep copy and the columns should be equal but copied");
            Assert.AreNotSame(uiFormTab[0], clonedFormTab[0], "Should be a deep copy and the columns should be equal but copied (not same)");
        }
Exemplo n.º 6
0
        public void TestNotEquals_DifferentTabName()
        {
            //---------------Set up test pack-------------------
            UIFormTab uiFormTab1 = new UIFormTab("tab1");
            uiFormTab1.Add(CreateUIFormColumn_2Fields());
            UIFormTab uiFormTab2 = new UIFormTab("tab2");
            uiFormTab2.Add(CreateUIFormColumn_2Fields());

            //--------------Assert PreConditions----------------            
            Assert.AreNotEqual(uiFormTab2.Name, uiFormTab1.Name);
            //---------------Execute Test ----------------------
            Assert.IsFalse(uiFormTab2 == uiFormTab1);
            Assert.IsFalse(uiFormTab1.Equals(uiFormTab2));
            //Assert.AreNotEqual(uiFormTab1, uiFormTab2);
            //---------------Test Result -----------------------

            //---------------Tear Down -------------------------          
        }
Exemplo n.º 7
0
        public void TestNotEquals_DiffColCount()
        {
            //---------------Set up test pack-------------------
            UIFormTab uiFormTab1 = new UIFormTab();
            UIFormColumn uiFormColumn1 = CreateUIFormColumn_2Fields();
            UIFormColumn uiFormColumn2 = CreateUIFormColumn_2Fields("diffProp");
            UIFormTab uiFormTab2 = new UIFormTab();


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

            //---------------Execute Test ----------------------
            uiFormTab1.Add(uiFormColumn1);
            uiFormTab1.Add(uiFormColumn2);

            uiFormTab2.Add(uiFormColumn2);
            //---------------Test Result -----------------------
            Assert.IsFalse(uiFormTab2 == uiFormTab1);
            Assert.IsFalse(uiFormTab1.Equals(uiFormTab2));
            //---------------Tear Down -------------------------          
        }
Exemplo n.º 8
0
        public void TestNotEquals_DifferentField()
        {
            UIFormTab uiFormTab1 = new UIFormTab();
            UIFormColumn uiFormColumn1 = CreateUIFormColumn_2Fields();
            UIFormColumn uiFormColumn2 = CreateUIFormColumn_2Fields("diffProp");
            UIFormTab uiFormTab2 = new UIFormTab();

            uiFormTab1.Add(uiFormColumn1);

            uiFormTab2.Add(uiFormColumn2);

            Assert.IsFalse(uiFormTab2 == uiFormTab1);
            Assert.IsTrue(uiFormTab2 != uiFormTab1);
            Assert.IsFalse(uiFormTab1.Equals(uiFormTab2));
            //Assert.AreNotEqual(uiFormTab1, uiFormTab2);
        }