Esempio n. 1
0
        public async Task OnGetElement_ItRetrievesItemsByTypeAndIndex()
        {
            IWindow window = await App.CreateWindowWithContent(
                @"<ListBox MinWidth=""200"">
    <ListBoxItem Content=""Item1"" />
    <ListBoxItem Content=""Item2"" />
    <ListBoxItem Content=""Item3"" />
    <ListBoxItem Content=""Item4"" />
</ListBox>");

            IVisualElement element = await window.GetElement("/ListBoxItem[2]");

            Assert.AreEqual("Item3", await element.GetContent());
        }
Esempio n. 2
0
        public async Task OnGetElement_ItRetrievesItemsByTypeAndIndex()
        {
            await Window.SetXamlContent(
                @"<ListBox MinWidth=""200"">
    <ListBoxItem Content=""Item1"" />
    <ListBoxItem Content=""Item2"" />
    <ListBoxItem Content=""Item3"" />
    <ListBoxItem Content=""Item4"" />
</ListBox>");

            IVisualElement <ListBoxItem> element = await Window.GetElement <ListBoxItem>("/ListBoxItem[2]");

            Assert.AreEqual("Item3", await element.GetContent());
        }