Ejemplo n.º 1
0
        public void When_ordinal_that_is_not_present_is_searched_for_Then_exception_is_thrown(int ordinal)
        {
            var page = Threaded <Session>
                       .CurrentBlock <ByOrdinalPage>();

            var @by = new ByOrdinal(By.TagName("li"), ordinal);

            Action fn = () => @by.FindElement(page.Tag);

            fn.ShouldThrow <NotFoundException>();
        }
Ejemplo n.º 2
0
        public void When_ordinal_that_is_not_present_is_searched_for_Then_empty_collection_is_returned()
        {
            var page = Threaded <Session>
                       .CurrentBlock <ByOrdinalPage>();

            var @by = new ByOrdinal(By.TagName("li"), 100);

            @by.FindElements(page.Tag)
            .Should()
            .BeEmpty();
        }
Ejemplo n.º 3
0
        public void When_single_element_is_searched_for_Then_element_is_found(int ordinal, string text)
        {
            var page = Threaded <Session>
                       .CurrentBlock <ByOrdinalPage>();

            var @by = new ByOrdinal(By.TagName("li"), ordinal);

            var actual = @by.FindElement(page.Tag);

            actual.Text
            .Should()
            .Be(text);
        }
Ejemplo n.º 4
0
        public void When_element_collection_is_searched_for_Then_collection_with_single_element_is_found(int ordinal, string text)
        {
            var page = Threaded <Session>
                       .CurrentBlock <ByOrdinalPage>();

            var @by = new ByOrdinal(By.TagName("li"), ordinal);

            var actual = @by.FindElements(page.Tag);

            actual
            .Select(x => x.Text)
            .Should().HaveCount(1)
            .And.HaveElementAt(0, text);
        }