summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml.cs
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2017-02-02 10:57:50 +0100
committerGitHub <noreply@github.com>2017-02-02 10:57:50 +0100
commitfa0882114d31387acaa8d6f43b638a0bf1efa871 (patch)
treeda73c08286f19c2aae8cabbbfbf630e47ad9a7f5 /Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml.cs
parent72699e34b2f4b3e8a939eebe03240ca7511b50e7 (diff)
downloadxamarin-forms-fa0882114d31387acaa8d6f43b638a0bf1efa871.tar.gz
xamarin-forms-fa0882114d31387acaa8d6f43b638a0bf1efa871.tar.bz2
xamarin-forms-fa0882114d31387acaa8d6f43b638a0bf1efa871.zip
[XamlC] Produce correct mdb files (#699)
* [XamlC] change MockCompile (internal) API * [XamlC] fix debugging in unit test project * f * [XamlC] update cecil to 0.10.0-beta1-v2 * beta2 * avoid method duplication * [XamlC] force loading MdbReader and Writer * [XamlC] force use the writer in the other task too * [XamlC] fix test and test code generator * try building this * [XamlC] Ensure InitializeComponent is correctly routed * fix
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml.cs')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml.cs57
1 files changed, 57 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml.cs
new file mode 100644
index 00000000..05254770
--- /dev/null
+++ b/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml.cs
@@ -0,0 +1,57 @@
+using NUnit.Framework;
+using Xamarin.Forms.Core.UnitTests;
+
+namespace Xamarin.Forms.Xaml.UnitTests
+{
+ public partial class DefaultCtorRouting2 : ContentPage
+ {
+ [TypeConverter(typeof(IsCompiledTypeConverter))]
+ public bool IsCompiled { get; set; }
+
+ public DefaultCtorRouting2()
+ {
+ InitializeComponent();
+ }
+
+ [TestFixture]
+ class Tests
+ {
+ [SetUp]
+ public void Setup()
+ {
+ Device.PlatformServices = new MockPlatformServices();
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ Device.PlatformServices = null;
+ Internals.XamlLoader.XamlFileProvider = null;
+ }
+
+ [Test]
+ public void ShouldBeCompiled()
+ {
+ var p = new DefaultCtorRouting2();
+ Assert.True(p.IsCompiled);
+ }
+
+ [Test]
+ public void ShouldntBeCompiled()
+ {
+ Internals.XamlLoader.XamlFileProvider = (t) => {
+ if (t == typeof(DefaultCtorRouting2))
+ return @"<?xml version=""1.0"" encoding=""UTF-8""?>
+<ContentPage xmlns=""http://xamarin.com/schemas/2014/forms""
+ xmlns:x=""http://schemas.microsoft.com/winfx/2009/xaml""
+ x:Class=""Xamarin.Forms.Xaml.UnitTests.DefaultCtorRouting2""
+ IsCompiled=""IsCompiled?"">
+</ContentPage>";
+ return null;
+ };
+ var p = new DefaultCtorRouting2();
+ Assert.False(p.IsCompiled);
+ }
+ }
+ }
+} \ No newline at end of file