-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
TextTests.cs
50 lines (46 loc) · 1.61 KB
/
TextTests.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Threading.Tasks;
using NUnit.Framework;
using NUnit.Framework.Internal;
namespace Xamarin.Forms.Platform.Android.UnitTests
{
[TestFixture]
public class TextTests : PlatformTestFixture
{
[Test, Category("Text"), Category("Label")]
[Description("Label text should match renderer text")]
public async Task LabelTextMatchesRendererText()
{
var label = new Label { Text = "foo" };
var expected = label.Text;
var actual = await GetControlProperty(label, control => control.Text);
Assert.That(actual, Is.EqualTo(expected));
}
[Test, Category("Text"), Category("Button")]
[Description("Button text should match renderer text")]
public async Task ButtonTextMatchesRendererText()
{
var button = new Button { Text = "foo" };
var expected = button.Text;
var actual = await GetControlProperty(button, control => control.Text);
Assert.That(actual, Is.EqualTo(expected));
}
[Test, Category("Text"), Category("Entry")]
[Description("Entry text should match renderer text")]
public async Task EntryTextMatchesRendererText()
{
var entry = new Entry { Text = "foo" };
var expected = entry.Text;
var actual = await GetControlProperty(entry, control => control.Text);
Assert.That(actual, Is.EqualTo(expected));
}
[Test, Category("Text"), Category("Editor")]
[Description("Editor text should match renderer text")]
public async Task EditorTextMatchesRendererText()
{
var editor = new Editor { Text = "foo" };
var expected = editor.Text;
var actual = await GetControlProperty(editor, control => control.Text);
Assert.That(actual, Is.EqualTo(expected));
}
}
}