2016-03-22 23:02:25 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
using Xamarin.Forms;
|
|
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
2016-12-13 00:02:37 +03:00
|
|
|
|
using Xamarin.Forms.Core.UnitTests;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
|
|
|
|
namespace Xamarin.Forms.Xaml.UnitTests
|
|
|
|
|
{
|
|
|
|
|
public partial class StringLiterals : ContentPage
|
|
|
|
|
{
|
|
|
|
|
public StringLiterals ()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public StringLiterals (bool useCompiledXaml)
|
|
|
|
|
{
|
|
|
|
|
//this stub will be replaced at compile time
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class Tests
|
|
|
|
|
{
|
2016-12-13 00:02:37 +03:00
|
|
|
|
[SetUp]
|
|
|
|
|
public void Setup()
|
|
|
|
|
{
|
|
|
|
|
Device.PlatformServices = new MockPlatformServices();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TearDown]
|
|
|
|
|
public void TearDown()
|
|
|
|
|
{
|
|
|
|
|
Device.PlatformServices = null;
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-22 23:02:25 +03:00
|
|
|
|
[TestCase(false)]
|
|
|
|
|
[TestCase(true)]
|
|
|
|
|
public void EscapedStringsAreTreatedAsLiterals (bool useCompiledXaml)
|
|
|
|
|
{
|
|
|
|
|
var layout = new StringLiterals (useCompiledXaml);
|
|
|
|
|
Assert.AreEqual ("Foo", layout.label0.Text);
|
|
|
|
|
Assert.AreEqual ("{Foo}", layout.label1.Text);
|
|
|
|
|
Assert.AreEqual ("Foo", layout.label2.Text);
|
|
|
|
|
Assert.AreEqual ("Foo", layout.label3.Text);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|