blob: 895eb9008aa292722a2e8158f270098de3390ebe (
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
|
using System;
using NUnit.Framework;
namespace Xamarin.Forms.Xaml.UnitTests
{
[TestFixture]
public class Issue1564
{
[Test]
public void ViewCellAsXamlRoot ()
{
var xaml = @"<?xml version=""1.0"" encoding=""UTF-8""?>
<ViewCell
xmlns=""http://xamarin.com/schemas/2014/forms""
xmlns:x=""http://schemas.microsoft.com/winfx/2009/xaml""
x:Class=""m.transport.VehicleCell"">
<ViewCell.View>
<StackLayout>
<Label Text=""This is my label""></Label>
</StackLayout>
</ViewCell.View>
</ViewCell>";
var cell = new ViewCell ().LoadFromXaml (xaml);
Assert.NotNull (cell);
Assert.AreEqual ("This is my label", ((cell.View as StackLayout).Children [0] as Label).Text);
}
}
}
|