Exemplo n.º 1
0
        public void SelectedValueElement_WhenTargetIsNotASelectElement_ShouldThrow()
        {
            //arrange
            var target   = Target.The("selected element").LocatedBy(By.Id("NotASelectElement"));
            var question = SelectedValue.Of(target);

            //act
            Assert.Throws <UnexpectedTagNameException>(() => Answer(question));
        }
Exemplo n.º 2
0
        public void SelectedValueElement_ShouldReturnCorrectValue(string id, string expected)
        {
            //arrange
            var target   = Target.The("selected element").LocatedBy(By.Id(id));
            var question = SelectedValue.Of(target);
            //act
            var actual = Answer(question);

            //assert
            Assert.Equal(expected, actual);
        }
Exemplo n.º 3
0
        public void SelectByIndexAction_ShouldSelectCorrectElement(int index, string expected)
        {
            //arrange
            Fixture.WebDriver.Navigate().Refresh();
            var action = Select.TheIndex(index).Into(SelectElementTarget);

            //act
            Fixture.Actor.When(action);
            var actual = Answer(SelectedValue.Of(SelectElementTarget).Value);

            //assert
            Assert.Equal(expected, actual);
        }
Exemplo n.º 4
0
 internal override IQuestion <T> CreateQuestion <T>(ITarget target, IConverters <T> converters, CultureInfo culture)
 {
     return(Apply(SelectedValue.Of(target), converters, culture));
 }