public void TitleLabelBoundPropertyTest() { var target = new HomeView().TitleLabel as BindableObject; var actual = target.GetBinding(Label.TextProperty); Assert.NotNull(actual); Assert.IsType <Binding>(actual); Assert.Equal("Title", actual.Path); }
public void TitleLabelModeTest() { var target = new HomeView().TitleLabel as BindableObject; var actual = target.GetBinding(Label.TextProperty); Assert.NotNull(actual); Assert.IsType <Binding>(actual); Assert.Equal("Title", actual.Path); Assert.Equal("Header", actual.FallbackValue); Assert.Equal(BindingMode.OneTime, actual.Mode); }
public void TitleLabelModeTest() { MockForms.Init(); var target = new HomeView().TitleLabel as BindableObject; var actual = target.GetBinding(Label.TextProperty); Assert.True( actual is Binding, "The value of the `Text` property in the `TitleLabel` control should be data-bound." ); Assert.True( (actual as Binding).Mode == BindingMode.OneWay, "The binding for the `Text` property in the `TitleLabel` control should have it's `Mode` set to `OneWay`." ); }
public void TitleLabelFallbackValueTest() { MockForms.Init(); var target = new HomeView().TitleLabel as BindableObject; var actual = target.GetBinding(Label.TextProperty); Assert.True( actual is Binding, "The value of the `Text` property in the `TitleLabel` control should be data-bound." ); Assert.True( ((actual as Binding).FallbackValue as string) == "Header", "The binding for the `Text` property in the `TitleLabel` control should have it's `FallbackValue` set to `Header`." ); }
public void TitleLabelBoundPropertyTest() { MockForms.Init(); var target = new HomeView().TitleLabel as BindableObject; var actual = target.GetBinding(Label.TextProperty); Assert.True( actual is Binding, "The value of the `Text` property in the `TitleLabel` control should be data-bound." ); Assert.True( (actual as Binding).Path == "Title", "The value of the `Text` property in the `TitleLabel` control should be data-bound to the `Title` property of the BindingContext." ); }
public void PeopleListViewItemsSourceBindingModeTest() { MockForms.Init(); var target = new HomeView().PeopleListView as BindableObject; var actual = target.GetBinding(ListView.ItemsSourceProperty); Assert.True( actual is Binding, "The value of the `ItemsSource` property in the `PeopleListView` control should be data-bound." ); Assert.True( (actual as Binding).Mode == BindingMode.OneWay, "The binding for the `ItemsSource` property in the `PeopleListView` control should have it's `Mode` set to `OneWay`." ); }
public void PeopleListViewItemsSourceBindingPathTest() { MockForms.Init(); var target = new HomeView().PeopleListView as BindableObject; var actual = target.GetBinding(ListView.ItemsSourceProperty); Assert.True( actual is Binding, "The value of the `ItemsSource` property in the `PeopleListView` control should be data-bound." ); Assert.True( (actual as Binding).Path == "People", "The value of the `ItemsSource` property in the `PeopleListView` control should be data-bound to the `People` property of the ViewModel (BindingContext)." ); }