blob: d4bbeff20ca8241caf34222a90cf01e8bdea8eda (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
using System;
using System.Collections.Generic;
using NUnit.Framework;
using Xamarin.Forms;
namespace Xamarin.Forms.Xaml.UnitTests
{
public partial class Unreported004 : ContentPage
{
public Unreported004()
{
InitializeComponent();
}
public Unreported004(bool useCompiledXaml)
{
//this stub will be replaced at compile time
}
public static readonly BindableProperty SomePropertyProperty =
BindableProperty.Create("SomeProperty", typeof(string),
typeof(Unreported004), null);
public static string GetSomeProperty(BindableObject bindable)
{
return bindable.GetValue(SomePropertyProperty) as string;
}
public static string GetSomeProperty(BindableObject bindable, object foo)
{
return null;
}
public static void SetSomeProperty(BindableObject bindable, string value)
{
bindable.SetValue(SomePropertyProperty, value);
}
[TestFixture]
class Tests
{
[TestCase(true), TestCase(false)]
public void MultipleGetMethodsAllowed(bool useCompiledXaml)
{
var page = new Unreported004(useCompiledXaml);
Assert.NotNull(page.label);
Assert.AreEqual("foo", GetSomeProperty(page.label));
}
}
}
}
|