コード例 #1
0
ファイル: TestUIGrid.cs プロジェクト: kevinbosman/habanero
        public void TestCloneUIGrid()
        {
            UIGridColumn uiGridCol = new UIGridColumn("Head", "Prop", "control", "Assembly",true,100, PropAlignment.centre, null);
            UIGrid uiGrid = new UIGrid();
            uiGrid.SortColumn = "Prop";
            uiGrid.Add(uiGridCol);

            //---------------Execute Test ----------------------
            IUIGrid clonedGrid = uiGrid.Clone();

            //---------------Test Result -----------------------
            Assert.IsTrue(uiGrid.Equals(clonedGrid));
            Assert.IsTrue(uiGrid == (UIGrid) clonedGrid);
            Assert.IsFalse(uiGrid != (UIGrid) clonedGrid);
            Assert.AreEqual(uiGrid[0], clonedGrid[0],
                              "Should be a deep copy and the columns should be equal but copied");
            Assert.AreNotSame(uiGrid[0], clonedGrid[0], "Should be a deep copy and the columns should be equal but copied (not same)");
        }
コード例 #2
0
        public void TestCloneUIGrid()
        {
            UIGridColumn uiGridCol = new UIGridColumn("Head", "Prop", "control", "Assembly", true, 100, PropAlignment.centre, null);
            UIGrid       uiGrid    = new UIGrid();

            uiGrid.SortColumn = "Prop";
            uiGrid.Add(uiGridCol);

            //---------------Execute Test ----------------------
            IUIGrid clonedGrid = uiGrid.Clone();

            //---------------Test Result -----------------------
            Assert.IsTrue(uiGrid.Equals(clonedGrid));
            Assert.IsTrue(uiGrid == (UIGrid)clonedGrid);
            Assert.IsFalse(uiGrid != (UIGrid)clonedGrid);
            Assert.AreEqual(uiGrid[0], clonedGrid[0],
                            "Should be a deep copy and the columns should be equal but copied");
            Assert.AreNotSame(uiGrid[0], clonedGrid[0], "Should be a deep copy and the columns should be equal but copied (not same)");
        }