summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2017-01-26 09:25:22 +0100
committerKangho Hur <kangho.hur@samsung.com>2017-03-24 13:15:52 +0900
commitf8ec6a427b323dcb5ccee9b76137b031abf1f2ef (patch)
tree0ffc18d70975ae903560de19632e672836f917e9 /Xamarin.Forms.Xaml.UnitTests
parent537e376b79120c216331be581805f7652ee6d2d2 (diff)
downloadxamarin-forms-f8ec6a427b323dcb5ccee9b76137b031abf1f2ef.tar.gz
xamarin-forms-f8ec6a427b323dcb5ccee9b76137b031abf1f2ef.tar.bz2
xamarin-forms-f8ec6a427b323dcb5ccee9b76137b031abf1f2ef.zip
[Xaml] support CDATA (#698)
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml9
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml.cs46
2 files changed, 55 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml
new file mode 100644
index 00000000..cb280fcb
--- /dev/null
+++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml
@@ -0,0 +1,9 @@
+<?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.Bz40906">
+ <Label x:Name="label0">
+ <![CDATA[Foo]]>
+ </Label>
+ <Label x:Name="label1">
+ <![CDATA[Foo]]>Bar<![CDATA[>><<]]>
+ </Label>
+</ContentPage>
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml.cs
new file mode 100644
index 00000000..dd734550
--- /dev/null
+++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using NUnit.Framework;
+using Xamarin.Forms;
+using Xamarin.Forms.Core.UnitTests;
+
+namespace Xamarin.Forms.Xaml.UnitTests
+{
+ public partial class Bz40906 : ContentPage
+ {
+ public Bz40906()
+ {
+ InitializeComponent();
+ }
+
+ public Bz40906(bool useCompiledXaml)
+ {
+ //this stub will be replaced at compile time
+ }
+
+ [TestFixture]
+ class Tests
+ {
+ [SetUp]
+ public void Setup()
+ {
+ Device.PlatformServices = new MockPlatformServices();
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ Device.PlatformServices = null;
+ }
+
+ [TestCase(true)]
+ [TestCase(false)]
+ public void ParsingCDATA(bool useCompiledXaml)
+ {
+ var page = new Bz40906(useCompiledXaml);
+ Assert.AreEqual("Foo", page.label0.Text);
+ Assert.AreEqual("FooBar>><<", page.label1.Text);
+}
+ }
+ }
+}