public static void AssertIsCopy(ControlForm ControlForm, ControlForm ControlFormCopy) { var groups = ControlForm.Controls.OfType <Group>(); var groupsCopy = ControlFormCopy.Controls.OfType <Group>(); Assert.AreEqual(ControlForm.Text, ControlFormCopy.Text); Assert.AreEqual(ControlForm.Width, ControlFormCopy.Width); Assert.AreEqual(ControlForm.Height, ControlFormCopy.Height); Assert.AreEqual(groups.Count(), groupsCopy.Count()); for (var i = 0; i < groups.Count(); i++) { GroupTests.AssertIsCopy(groups.ElementAt(i), groupsCopy.ElementAt(i)); } }
public void OpenConfig() { // Arrange var controlForm = GetControlForm(); var controlFormFromConfig = GetControlForm(); controlForm.Text = "Form"; controlForm.Width = 100; controlForm.Height = 200; controlForm.Controls.Add(GroupTests.GetGroup(controlForm)); // Act controlFormFromConfig.FromConfig(controlForm.GetConfig()); // Assert AssertIsCopy(controlForm, controlFormFromConfig); }