예제 #1
0
        public virtual void GetContainerForItemOverride()
        {
            IPoker p      = CurrentControl;
            var    first  = p.GetContainerForItemOverride_();
            var    second = p.GetContainerForItemOverride_();

            Assert.AreNotSame(first, second, "ReferenceEquals");
        }
예제 #2
0
파일: SelectorTest.cs 프로젝트: ynkbt/moon
        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");
        }
예제 #3
0
파일: SelectorTest.cs 프로젝트: ynkbt/moon
        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");
        }
예제 #4
0
파일: SelectorTest.cs 프로젝트: ynkbt/moon
        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");
        }