-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
CollectionViewItemsSourceTypes.cs
69 lines (64 loc) · 1.38 KB
/
CollectionViewItemsSourceTypes.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.Forms.Core.UITests;
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.CollectionView)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.None, 0, "CollectionView ItemsSource Types", PlatformAffected.All)]
public class CollectionViewItemsSourceTypes : TestContentPage
{
protected override void Init()
{
Content = new StackLayout()
{
Children =
{
new Label()
{
Text = "If you see three 900s this test has passed"
},
new CollectionView()
{
ItemsSource = new[] { 900 },
HeightRequest = 50
},
new CollectionView()
{
ItemsSource = new[] { "900" }.ToList<object>(),
HeightRequest = 50
},
new CollectionView()
{
ItemsSource = new ObservableCollection<string>(new[] { "900" }),
HeightRequest = 50
}
}
};
}
#if UITEST
[Test]
public void CollectionViewItemsSourceTypesDisplayAndDontCrash()
{
RunningApp.QueryUntilPresent(() =>
{
var result = RunningApp.WaitForElement("900");
if (result.Length == 3)
return result;
return null;
});
}
#endif
}
}