summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests/Issues/Issue2742.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/Issues/Issue2742.xaml.cs')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Issue2742.xaml.cs45
1 files changed, 45 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Issue2742.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Issue2742.xaml.cs
new file mode 100644
index 00000000..ba69280d
--- /dev/null
+++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Issue2742.xaml.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+
+using Xamarin.Forms;
+
+using NUnit.Framework;
+
+namespace Xamarin.Forms.Xaml.UnitTests
+{
+ public class Issue2742BasePage : ContentPage
+ {
+
+ }
+
+ public partial class Issue2742 : Issue2742BasePage
+ {
+ public Issue2742 ()
+ {
+ InitializeComponent ();
+ }
+
+ public Issue2742 (bool useCompiledXaml)
+ {
+ //this stub will be replaced at compile time
+ }
+
+
+ [TestFixture]
+ public class Tests
+ {
+ [TestCase (false)]
+ [TestCase (true)]
+ public void ToolBarItemsOnContentPageInheritors (bool useCompiledXaml)
+ {
+ var layout = new Issue2742 (useCompiledXaml);
+ Assert.That (layout.Content, Is.TypeOf<Label> ());
+ Assert.AreEqual ("test", ((Label)layout.Content).Text);
+
+ Assert.NotNull (layout.ToolbarItems);
+ Assert.AreEqual (2, layout.ToolbarItems.Count);
+ Assert.AreEqual ("One", layout.ToolbarItems [0].Name);
+ }
+ }
+ }
+} \ No newline at end of file