Beispiel #1
0
        public void ObservableListSource_exposes_ObervableCollection_IEnumerable_constructor()
        {
            IEnumerable <FakeEntity> entities = new[] { new FakeEntity(), new FakeEntity() };
            var ols = new ObservableListSource <FakeEntity>(entities);

            Assert.Equal(2, ols.Count);
        }
Beispiel #2
0
        public void The_BindingList_returned_from_ObservableListSource_GetList_is_cached()
        {
            var ols         = new ObservableListSource <FakeEntity>();
            var bindingList = ((IListSource)ols).GetList();

            Assert.Same(bindingList, ((IListSource)ols).GetList());
        }
Beispiel #3
0
        public void ObservableListSource_exposes_ObervableCollection_List_constructor()
        {
            var entities = new List <FakeEntity>
            {
                new FakeEntity(),
                new FakeEntity()
            };
            var ols = new ObservableListSource <FakeEntity>(entities);

            Assert.Equal(2, ols.Count);
        }
Beispiel #4
0
        public void ObservableListSource_GetList_returns_BindingList_attached_to_the_ObservableCollection()
        {
            var ols = new ObservableListSource <FakeEntity>
            {
                new FakeEntity(),
                new FakeEntity()
            };
            var bindingList = ((IListSource)ols).GetList();

            Assert.Equal(2, bindingList.Count);

            ols.Add(new FakeEntity());
            Assert.Equal(3, bindingList.Count);

            ols.Remove(ols[0]);
            Assert.Equal(2, bindingList.Count);

            bindingList.Add(new FakeEntity());
            Assert.Equal(3, ols.Count);

            bindingList.RemoveAt(0);
            Assert.Equal(2, ols.Count);
        }
Beispiel #5
0
        public void ObservableListSource_exposes_ObervableCollection_parameterless_constructor()
        {
            var ols = new ObservableListSource <FakeEntity>();

            Assert.Equal(0, ols.Count);
        }