Ejemplo n.º 1
0
        public void TestBasicAdapterClearBox()
        {
            atc.Run(async() =>
            {
                var adapter = new TestAdapter();
                m_AdapterListView.SetAdapter(adapter);

                await WaitForUiThreadRender();

                adapter.BindCount.ShouldBe(adapter.GetEntryCount(), "Number of entries are not being respected.");
                var listView = m_AdapterListView.Q <ListView>(className: AdapterListView.ListViewUssClassName);
                var entries  = listView.Query <TextElement>().ToList();

                // Ensure the entries are displayed correctly and in order.
                entries.Count.ShouldBe(adapter.GetEntryCount(), "Should be the correct number of entries in the layout");
                for (var i = 0; i < adapter.GetEntryCount(); i++)
                {
                    entries[i].text.ShouldBe(i.ToString(), "The values should match");
                }
            });
        }
Ejemplo n.º 2
0
        public void TestBasicAdapter()
        {
            atc.Run(async() =>
            {
                var adapter = new TestAdapter();
                m_AdapterListView.SetAdapter(adapter);

                await WaitForUiThreadRender();

                UITestHelpers.IsCompletelyVisible(m_Window, m_AdapterListView).ShouldBe(true, "The adapter listview should be visible.");
                adapter.BindCount.ShouldBe(adapter.GetEntryCount(), "Number of entries are not being respected.");
            });
        }
Ejemplo n.º 3
0
        public void TestDataUpdate()
        {
            atc.Run(async() =>
            {
                var adapter = new TestAdapter();
                m_AdapterListView.SetAdapter(adapter);

                await WaitForUiThreadRender();

                adapter.NotifyDataSetChanged();

                await WaitForUiThreadRender();

                adapter.BindCount.ShouldBe(adapter.GetEntryCount() * 2, "Entries are not being reloaded.");
            });
        }