public void WpfDemoCheckCheckBox() { Assert.IsTrue(_fixture.SelectItem("Caption:Usual Controls"), "Select 'Usual Controls' tab"); UiAutomationFixture.SearchBy("id"); Assert.AreEqual("Off", _fixture.ValueOfControl("CheckBox1"), "Default value of CheckBox1"); Assert.IsTrue(_fixture.ToggleControl("CheckBox1"), "First toggle on CheckBox1"); Assert.AreEqual("On", _fixture.ValueOfControl("CheckBox1"), "Value of CheckBox1 after first toggle"); Assert.AreEqual("Checked CheckBox1", _fixture.ValueOfControl("TextBlock1")); Assert.IsTrue(_fixture.ToggleControl("CheckBox1"), "Second toggle on CheckBox1"); Assert.AreEqual("Off", _fixture.ValueOfControl("CheckBox1"), "Value of CheckBox1 after second toggle"); Assert.AreEqual("Unchecked CheckBox1", _fixture.ValueOfControl("TextBlock1")); Assert.AreEqual("Off", _fixture.ValueOfControl("ThreeStateCheckBox"), "Default Value of ThreeStateCheckBox"); Assert.IsTrue(_fixture.ToggleControl("ThreeStateCheckBox"), "First toggle on ThreeStateCheckBox"); Assert.AreEqual("On", _fixture.ValueOfControl("ThreeStateCheckBox"), "Value of ThreeStateCheckBox after first toggle"); Assert.AreEqual("Checked ThreeStateCheckBox", _fixture.ValueOfControl("TextBlock1")); Assert.IsTrue(_fixture.ToggleControl("ThreeStateCheckBox"), "Second toggle on ThreeStateCheckBox"); Assert.AreEqual("Indeterminate", _fixture.ValueOfControl("ThreeStateCheckBox"), "Value of ThreeStateCheckBox after second toggle"); Assert.IsTrue(_fixture.ToggleControl("ThreeStateCheckBox"), "Third toggle on ThreeStateCheckBox"); Assert.AreEqual("Off", _fixture.ValueOfControl("ThreeStateCheckBox"), "Value of ThreeStateCheckBox after third toggle"); Assert.AreEqual("Unchecked ThreeStateCheckBox", _fixture.ValueOfControl("TextBlock1")); Assert.IsFalse(_fixture.ToggleControl("DisabledCheckBox"), "Toggle on DisabledCheckBox"); }
public void FixtureTestUnrecognizedConditionType() => Assert.IsFalse(_fixture.ToggleControl("NonExistingConditionType:RandomValue"));