diff options
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/Issues')
-rw-r--r-- | Xamarin.Forms.Xaml.UnitTests/Issues/Bz49307.xaml | 7 | ||||
-rw-r--r-- | Xamarin.Forms.Xaml.UnitTests/Issues/Bz49307.xaml.cs | 47 |
2 files changed, 54 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz49307.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz49307.xaml new file mode 100644 index 00000000..3bb6e203 --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz49307.xaml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Application xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Xamarin.Forms.Xaml.UnitTests.Bz49307"> + <Application.Resources> + <!-- Application resource dictionary --> + <Color x:Key="MyColor">#c2d1d3</Color> + </Application.Resources> +</Application> diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz49307.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz49307.xaml.cs new file mode 100644 index 00000000..166706af --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz49307.xaml.cs @@ -0,0 +1,47 @@ +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 Bz49307 : Application + { + public Bz49307() + { + InitializeComponent(); + } + + public Bz49307(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 ThrowOnMissingDictionary(bool useCompiledXaml) + { + if (useCompiledXaml) + Assert.Throws<NullReferenceException>(() => new Bz49307(useCompiledXaml)); + else + Assert.Throws(new XamlParseExceptionConstraint(5, 4), () => new Bz49307(useCompiledXaml)); + } + } + } +}
\ No newline at end of file |