summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests/Compiled/FindByName.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/Compiled/FindByName.xaml.cs')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Compiled/FindByName.xaml.cs40
1 files changed, 40 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/Compiled/FindByName.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Compiled/FindByName.xaml.cs
new file mode 100644
index 00000000..0ec198e8
--- /dev/null
+++ b/Xamarin.Forms.Xaml.UnitTests/Compiled/FindByName.xaml.cs
@@ -0,0 +1,40 @@
+´╗┐using NUnit.Framework;
+
+using Xamarin.Forms;
+
+namespace Xamarin.Forms.Xaml.UnitTests.Compiled
+{
+ 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"));
+ }
+ }
+ }
+} \ No newline at end of file