forked from xamarin/Xamarin.Forms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindByName.xaml.cs
40 lines (35 loc) · 879 Bytes
/
FindByName.xaml.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
using NUnit.Framework;
using Xamarin.Forms;
namespace Xamarin.Forms.Xaml.UnitTests
{
public partial class FindByName : ContentPage
{
public FindByName ()
{
InitializeComponent ();
}
public FindByName (bool useCompiledXaml)
{
//this stub will be replaced at compile time
}
[TestFixture]
public class FindByNameTests
{
[TestCase (false)]
[TestCase (true)]
public void TestRootName (bool useCompiledXaml)
{
var page = new FindByName (useCompiledXaml);
Assert.AreSame (page, ((Forms.Internals.INameScope)page).FindByName ("root"));
Assert.AreSame (page, page.FindByName<FindByName> ("root"));
}
[TestCase (false)]
[TestCase (true)]
public void TestName (bool useCompiledXaml)
{
var page = new FindByName (useCompiledXaml);
Assert.AreSame (page.label0, page.FindByName<Label> ("label0"));
}
}
}
}