示例#1
0
        public static Group GetGroup(ControlForm ControlForm)
        {
            var group   = Group.FromLocation(ControlForm.ControlPlugins, new Point(1, 2));
            var control = ControlTests.GetControl(ControlForm);

            group.Text = "Group";
            group.Controls.Add(control);

            return(group);
        }
示例#2
0
        public static void AssertIsCopy(Group Group, Group GroupCopy)
        {
            var controls     = Group.Controls.OfType <Control>();
            var controlsCopy = GroupCopy.Controls.OfType <Control>();

            Assert.AreNotSame(Group, GroupCopy);
            Assert.IsTrue(Group.ControlPlugins.All(x => GroupCopy.ControlPlugins.Any(y => y.GetType() == x.GetType())));
            Assert.AreEqual(Group.Text, GroupCopy.Text);
            Assert.AreEqual(Group.Location, GroupCopy.Location);
            Assert.AreEqual(controls.Count(), controlsCopy.Count());

            for (var i = 0; i < controls.Count(); i++)
            {
                ControlTests.AssertIsCopy(controls.ElementAt(i), controlsCopy.ElementAt(i));
            }
        }