summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests/FontConverterTests.cs
blob: fc5e25b097b80b949eaef0ccaea06be64a56531d (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
using NUnit.Framework;
using Xamarin.Forms.Core.UnitTests;

namespace Xamarin.Forms.Xaml.UnitTests
{
	[TestFixture]
	public class FontConverterTests : BaseTestFixture
	{
		[TestCase ("Bold", Forms.FontAttributes.Bold)]
		[TestCase ("Italic", Forms.FontAttributes.Italic)]
		[TestCase ("Bold, Italic", Forms.FontAttributes.Bold | Forms.FontAttributes.Italic)]
		public void FontAttributes (string attributeString, FontAttributes result)
		{
			var xaml = @"
			<Label 
				xmlns=""http://xamarin.com/schemas/2014/forms""
				xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" FontAttributes=""" + result + @""" />";

			Device.PlatformServices = new MockPlatformServices ();

			var label = new Label ().LoadFromXaml (xaml);

			Assert.AreEqual (result, label.FontAttributes);
			Assert.AreEqual (result, label.Font.FontAttributes);
		}
	}
}