-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
LabelHtml.xaml.cs
33 lines (30 loc) · 970 Bytes
/
LabelHtml.xaml.cs
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
using NUnit.Framework;
using Xamarin.Forms.Core.UnitTests;
namespace Xamarin.Forms.Xaml.UnitTests
{
public partial class LabelHtml : ContentPage
{
public LabelHtml() => InitializeComponent();
public LabelHtml(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;
[Test]
public void HtmlInCDATA([Values(true, false)]bool useCompiledXaml)
{
var html = "<h1>Hello World!</h1><br/>SecondLine";
var layout = new LabelHtml(useCompiledXaml);
Assert.That(layout.label0.Text, Is.EqualTo(html));
Assert.That(layout.label1.Text, Is.EqualTo(html));
Assert.That(layout.label2.Text, Is.EqualTo(html));
Assert.That(layout.label3.Text, Is.EqualTo(html));
Assert.That(layout.label4.Text, Is.EqualTo(html));
}
}
}
}