public virtual void GetContainerForItemOverride() { IPoker p = CurrentControl; var first = p.GetContainerForItemOverride_(); var second = p.GetContainerForItemOverride_(); Assert.AreNotSame(first, second, "ReferenceEquals"); }
public virtual void PrepareContainerForItemOverride_DisplayMemberPath() { IPoker poker = CurrentControl; ListBoxItem element = (ListBoxItem)poker.GetContainerForItemOverride_(); string item = "hi"; poker.DisplayMemberPath = "length"; poker.PrepareContainerForItemOverride_(element, item); Assert.AreEqual(element.ReadLocalValue(ContentControl.ContentProperty), item, "binding is unset"); }
public virtual void PrepareContainerForItemOverride_defaults() { IPoker poker = CurrentControl; ListBoxItem element = (ListBoxItem)poker.GetContainerForItemOverride_(); string item = "hi"; poker.PrepareContainerForItemOverride_(element, item); Assert.AreEqual(element.Content, item, "string is content"); Assert.IsNotNull(element.ContentTemplate, "content template is null"); Assert.IsNull(element.Style, "style is null"); }
public virtual void PrepareContainerForItemOverride_IsSelected() { IPoker poker = CurrentControl; ListBoxItem element = (ListBoxItem)poker.GetContainerForItemOverride_(); string item = "hi"; element.IsSelected = true; poker.PrepareContainerForItemOverride_(element, item); Assert.IsNull(poker.SelectedItem, "selected item before it's been inserted"); Assert.AreEqual(-1, poker.SelectedIndex, "-1 selected index"); }