summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2016-11-17 20:31:05 +0100
committerGitHub <noreply@github.com>2016-11-17 20:31:05 +0100
commit054ecf2704ac5d736ffb97c2932e1e078041008a (patch)
tree6e11e80a370b9ed96c473a03ecc4bbdfefa62cbe /Xamarin.Forms.Xaml.UnitTests
parent122f0e3e6060711d6c3b2b8523236b8a057434df (diff)
downloadxamarin-forms-054ecf2704ac5d736ffb97c2932e1e078041008a.tar.gz
xamarin-forms-054ecf2704ac5d736ffb97c2932e1e078041008a.tar.bz2
xamarin-forms-054ecf2704ac5d736ffb97c2932e1e078041008a.zip
[Xaml] cleanup xmlns usage, add XmlnsDefinition (#531)
* [Xaml] cleanup xmlns usage, add XmlnsDefinition * docs
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Issue1637.cs2
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/LoaderTests.cs10
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/TypeExtensionTests.cs7
3 files changed, 10 insertions, 9 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Issue1637.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Issue1637.cs
index f6083fb1..8fb1759a 100644
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Issue1637.cs
+++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Issue1637.cs
@@ -10,7 +10,7 @@ namespace Xamarin.Forms.Xaml.UnitTests
public void ImplicitCollectionWithSingleElement ()
{
var xaml = @"
- <Grid>
+ <Grid xmlns=""http://xamarin.com/schemas/2014/forms"">
<Grid.RowDefinitions>
<RowDefinition Height=""*"" />
</Grid.RowDefinitions>
diff --git a/Xamarin.Forms.Xaml.UnitTests/LoaderTests.cs b/Xamarin.Forms.Xaml.UnitTests/LoaderTests.cs
index f132b19c..4d3e004a 100644
--- a/Xamarin.Forms.Xaml.UnitTests/LoaderTests.cs
+++ b/Xamarin.Forms.Xaml.UnitTests/LoaderTests.cs
@@ -381,9 +381,9 @@ namespace Xamarin.Forms.Xaml.UnitTests
[Test]
public void MissingStaticResourceShouldThrow ()
{
- var xaml = @"<Label Text=""{StaticResource foo}""/>";
+ var xaml = @"<Label xmlns=""http://xamarin.com/schemas/2014/forms"" Text=""{StaticResource foo}""/>";
var label = new Label ();
- Assert.Throws (new XamlParseExceptionConstraint (1, 8), () => label.LoadFromXaml (xaml));
+ Assert.Throws (new XamlParseExceptionConstraint (1, 54), () => label.LoadFromXaml (xaml));
}
public class CustView : Button
@@ -605,7 +605,7 @@ namespace Xamarin.Forms.Xaml.UnitTests
public void TestCollectionContentProperties ()
{
var xaml = @"
- <StackLayout>
+ <StackLayout xmlns=""http://xamarin.com/schemas/2014/forms"">
<Label Text=""Foo""/>
<Label Text=""Bar""/>
</StackLayout>";
@@ -619,7 +619,7 @@ namespace Xamarin.Forms.Xaml.UnitTests
public void TestCollectionContentPropertiesWithSingleElement ()
{
var xaml = @"
- <StackLayout>
+ <StackLayout xmlns=""http://xamarin.com/schemas/2014/forms"">
<Label Text=""Foo""/>
</StackLayout>";
var layout = new StackLayout ().LoadFromXaml (xaml);
@@ -796,7 +796,7 @@ namespace Xamarin.Forms.Xaml.UnitTests
public void StyleWithoutTargetTypeThrows ()
{
var xaml = @"
- <Label>
+ <Label xmlns=""http://xamarin.com/schemas/2014/forms"">
<Label.Style>
<Style>
<Setter Property=""Text"" Value=""Foo"" />
diff --git a/Xamarin.Forms.Xaml.UnitTests/TypeExtensionTests.cs b/Xamarin.Forms.Xaml.UnitTests/TypeExtensionTests.cs
index 49c4bb49..0eec655c 100644
--- a/Xamarin.Forms.Xaml.UnitTests/TypeExtensionTests.cs
+++ b/Xamarin.Forms.Xaml.UnitTests/TypeExtensionTests.cs
@@ -19,9 +19,10 @@ namespace Xamarin.Forms.Xaml.UnitTests
{
base.Setup ();
var nsManager = new XmlNamespaceManager (new NameTable ());
- nsManager.AddNamespace ("local", "clr-namespace:Xamarin.Forms.Xaml.UnitTests;assembly=Xamarin.Forms.Xaml.UnitTests");
- nsManager.AddNamespace ("sys", "clr-namespace:System;assembly=mscorlib");
- nsManager.AddNamespace ("x", "http://schemas.microsoft.com/winfx/2006/xaml");
+ nsManager.AddNamespace("", "http://xamarin.com/schemas/2014/forms");
+ nsManager.AddNamespace("local", "clr-namespace:Xamarin.Forms.Xaml.UnitTests;assembly=Xamarin.Forms.Xaml.UnitTests");
+ nsManager.AddNamespace("sys", "clr-namespace:System;assembly=mscorlib");
+ nsManager.AddNamespace("x", "http://schemas.microsoft.com/winfx/2006/xaml");
typeResolver = new Internals.XamlTypeResolver (nsManager, XamlParser.GetElementType, Assembly.GetCallingAssembly ());