summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests/Issues/Bz46921.xaml.cs
blob: 4f2f04d2738f59c188f8cf8e5070af6f8000da13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Collections.Generic;
using NUnit.Framework;
using Xamarin.Forms;

namespace Xamarin.Forms.Xaml.UnitTests
{
	public partial class Bz46921 : ContentPage
	{
		public Bz46921()
		{
			InitializeComponent();
		}

		public Bz46921(bool useCompiledXaml)
		{
			//this stub will be replaced at compile time
		}

		[TestFixture]
		class Tests
		{
			[TestCase(true)]
			[TestCase(false)]
			public void MultipleWaysToCreateAThicknessResource(bool useCompiledXaml)
			{
				var page = new Bz46921(useCompiledXaml);
				foreach (var resname in new string[] { "thickness0", "thickness1", "thickness2", "thickness3", }) {
					var resource = page.Resources[resname];
					Assert.That(resource, Is.TypeOf<Thickness>());
					var thickness = (Thickness)resource;
					Assert.AreEqual(new Thickness(4, 20, 4, 20), thickness);

				}
			}
		}
	}
}