public void CreateFormObject(Type objectType, Type formType) { object x = Activator.CreateInstance(objectType); var form = EditPathForm.FormForObject(x); form.Should().NotBeNull(); form.Should().BeOfType(formType); }
public void Parameters_Preview_Then_Close() { MilDotReticle mildot = new MilDotReticle(); ReticlePath path = new ReticlePath() { LineWidth = AngularUnit.MOA.New(0.1), Color = "black", Fill = true }; EditPathForm form = new EditPathForm(path, mildot); form.MeasurementControl("measurementWidth").Should().HaveValue(path.LineWidth.Value); form.ComboBox("comboBoxColor").Should().HaveText(path.Color); form.CheckBox("checkBoxFill").Should().BeChecked(); form.MeasurementControl("measurementWidth").Value = AngularUnit.MOA.New(21); form.ComboBox("comboBoxColor").Text = "aqua"; form.CheckBox("checkBoxFill").Checked = false; path.LineWidth.Should().NotBe(AngularUnit.MOA.New(21)); path.Color.Should().NotBe("aqua"); path.Fill.Should().NotBeFalse(); form.Save(); path.LineWidth.Should().Be(AngularUnit.MOA.New(21)); path.Color.Should().Be("aqua"); path.Fill.Should().BeFalse(); form.Close(); form.EditPathForm_FormClosed(this, new FormClosedEventArgs(CloseReason.UserClosing)); form.Dispose(); path.LineWidth.Should().Be(AngularUnit.MOA.New(0.1)); path.Color.Should().Be("black"); path.Fill.Should().BeTrue(); }