public void ControlExtension_OK() { using var tf = new TestForm(); var tb = tf.AddControl <TextBox>(1, 1, 5, 5); tb.Name = "testTextBox"; tf.Control("testTextBox", typeof(TextBox)).Should().NotBeNull(); tf.Control("testTextBox", typeof(TextBox)).Should().HaveType <TextBox>(); tf.Control <TextBox>("testTextBox").Should().NotBeNull(); tf.Control <TextBox>("testTextBox").Should().HaveType <TextBox>(); }
public void ControlMatch_FailPredicate() { using var tf = new TestForm(); var tb = tf.AddControl <TextBox>(1, 1, 5, 5); tb.Name = "testTextBox"; tf.Should().HaveControl <TextBox>("testTextBox"); ((Action)(() => tf.Control <TextBox>("testTextBox") .Should().MatchAs <TextBox>(tb => tb.Name == "testTextBax"))).Should().Throw <XunitException>(); }
public void ControlMatch_OK() { using var tf = new TestForm(); var tb = tf.AddControl <TextBox>(1, 1, 5, 5); tb.Name = "testTextBox"; tf.Should().HaveControl <TextBox>("testTextBox"); ((Action)(() => tf.Control <TextBox>("testTextBox") .Should().MatchAs <TextBox>(tb => tb.Name == "testTextBox"))).Should().NotThrow(); }